Projects
home:ajaissle
kolab-scripts
check-certs.sh
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File check-certs.sh of Package kolab-scripts
#!/bin/bash PATH=/usr/bin:/bin:/usr/sbin echo -n "Checking presence of server certificates... " cd /etc/ssl CERTDIR=servercerts CERTFILE=$CERTDIR/servercert.pem CERTKEY=$CERTDIR/serverkey.pem if [[ ! -f $CERTKEY ]]; then echo " ERROR: No certificate key found at $CERTKEY" CERT_PRESENCE=no elif [[ ! -s $CERTKEY ]]; then echo " ERROR: Certificate key has a size of zero!" CERT_PRESENCE=no fi if [[ ! -f $CERTFILE ]]; then echo " ERROR: No server certificate found at $CERTFILE" CERT_PRESENCE=no elif [[ ! -s $CERTFILE ]]; then echo " ERROR: Server certificate has a size of zero." CERT_PRESENCE=no fi if [[ "$CERT_PRESENCE" == "" ]]; then echo OK else echo echo " Run kolab-cert to create a server certificate and corresponding key" echo " Without this, Kolab won't work!" echo read -p "Do you want to run 'kolab-cert' now? [Y/n] " ANSWER [[ "$ANSWER" != "n" ]] && kolab-cert fi # set permissions on servercert, key and dir USERS="cyrus postfix" DIRS="$CERTDIR" FILES="$CERTFILE $CERTKEY" echo -n "Checking server certificate ACL... " for USER in $USERS; do for DIR in $DIRS; do if [[ $(getfacl $DIR | grep -c "^user:$USER:r-x") != 1 ]]; then echo -n " Setting ACL for $USER on $DIR... " setfacl -m u:$USER:rx $DIR if [[ $? == 0 ]]; then echo OK else echo FAILED! fi fi done for FILE in $FILES; do if [[ $(getfacl $FILE | grep -c "^user:$USER:r--") != 1 ]]; then echo -n " Setting ACL for $USER on $FILE... " setfacl -m u:$USER:r $FILE if [[ $? == 0 ]]; then echo OK else echo FAILED! fi fi done done
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.