ACTIONS="$ACTIONS,detach,stop-apache,stop-eg";
fi
+ if [[ "$ACTIONS" =~ "stop-apache" ]]; then
+ ACTIONS="$ACTIONS,detach";
+ fi
+
if [[ "$ACTIONS" =~ "deploy-all" ]]; then
ACTIONS="$ACTIONS,update-eg,deploy-eg";
fi
fi
if [[ "$ACTIONS" =~ "start-apache" ]]; then
+ set +e # temporarily disable exit-on-error setting
+ service apache2 status 2>&1 > /dev/null
+ stat=$?
+ set -e
+ if [ $stat -eq 0 ]; then # apache running
+ announce "Apache is already running. Stopping first..."
+ sudo service apache2 stop > /dev/null
+ sleep 3;
+ fi
announce "Starting Apache"
sudo service apache2 start > /dev/null
fi