#!/bin/sh clear optionstart= optionstartwoutnet= optionstop= optionhelp= while getopts :abch name do case $name in a) optionstart=1;; b) optionstartwoutnet=1;; c) optionstop=1;; h) optionhelp=1;; ?) echo "Usage: $0: options | -h (for options)" echo exit 2;; esac done if [ ! -z "$optionhelp" ]; then printf "Usage: %s [option] \n" $0 echo "options:" echo "[-a] to start" echo "[-b] to start without Network" echo "[-c] to stop" echo "[-h] for this help" fi if [ ! -z "$optionstart" ]; then echo "Apache und Mysql werden gestartet!" sudo /etc/init.d/apache2 start sudo /etc/init.d/mysql start fi if [ ! -z "$optionstartwoutnet" ]; then echo "Apache und Mysql werden gestartet!" sudo /sbin/ifconfig eth0 up sudo /etc/init.d/apache2 start sudo /etc/init.d/mysql start fi if [ ! -z "$optionstop" ]; then echo "Apache und Mysql werden beendet!" sudo /etc/init.d/apache2 stop sudo /etc/init.d/mysql stop fi