Projects
home:ajaissle
kolab-scripts
check-apache.sh
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File check-apache.sh of Package kolab-scripts
#!/bin/bash PATH=/usr/bin:/bin:/usr/sbin # If changes are made by this script, a restart of apache is # needed. However, as this script is most likely run before # kolab is configured, it does not make sense to include the # restart in this script. echo -n "Checking SSL apache flag in /etc/sysconfig/apache2... " eval $(grep ^APACHE_SERVER_FLAGS= /etc/sysconfig/apache2) for F in $APACHE_SERVER_FLAGS; do if [[ "$F" == "SSL" ]]; then HAS_SSL_FLAG=true break fi done if [[ "$HAS_SSL_FLAG" == "true" ]]; then echo OK else echo BACKUP="/tmp/kolab-check-etc_sysconfig_apache2-$(date +%s)" cp /etc/sysconfig/apache2 $BACKUP # Wait 1 second, so the next backup has a different timestamp sleep 1 sed -i "s/^APACHE_SERVER_FLAGS=.*/APACHE_SERVER_FLAGS=\"${APACHE_SERVER_FLAGS} SSL\"/;s/=\" /=\"/" /etc/sysconfig/apache2 echo " Added SSL apache flag to APACHE_SERVER_FLAGS in /etc/sysconfig/apache2" echo " Backup stored at: $BACKUP" echo fi echo -n "Checking required apache modules in /etc/sysconfig/apache2... " eval $(grep ^APACHE_MODULES= /etc/sysconfig/apache2) # REQ_MOD="ldap authnz_ldap dav dav_fs rewrite authn_alias php5" REQ_MOD="rewrite php5 ssl" for M in $REQ_MOD; do if ! grep -qw $M <<< "$APACHE_MODULES"; then MISSING_MODS="$MISSING_MODS$M " fi done if [[ -z "$MISSING_MODS" ]]; then echo OK else echo BACKUP="/tmp/kolab-check-etc_sysconfig_apache2-$(date +%s)" cp /etc/sysconfig/apache2 $BACKUP APACHE_MODULES="$APACHE_MODULES ${MISSING_MODS%% }" sed -i "s/^APACHE_MODULES=.*/APACHE_MODULES=\"$APACHE_MODULES\"/" /etc/sysconfig/apache2 echo " Added modules: ${MISSING_MODS%% } to APACHE_MODULES in /etc/sysconfig/apache2" echo " Backup stored at: $BACKUP" echo fi
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
.