First commit
This commit is contained in:
commit
17b678f06b
|
@ -0,0 +1,28 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if (( $EUID != 0 )); then
|
||||||
|
echo "Il faut les droit root pour executer la tache"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
serviceName=apache2
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
echo "démarage d'$serviceName"
|
||||||
|
action=start
|
||||||
|
;;
|
||||||
|
stop)
|
||||||
|
echo "arrêt de $serviceName"
|
||||||
|
action=stop
|
||||||
|
;;
|
||||||
|
|
||||||
|
reload)
|
||||||
|
echo "Reload de $serviceName"
|
||||||
|
action=reload
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "erreur $1 non reconnu"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
service $serviceName $action
|
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/bash
|
||||||
|
if (( $EUID != 0 )); then
|
||||||
|
echo "Il faut les droit root pour executer la tache"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
SERVICEtoSTART="apache2"
|
||||||
|
echo "Démarage d'$SERVICEtoSTART"
|
||||||
|
service "$SERVICEtoSTART" start
|
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/bash
|
||||||
|
if (( $EUID != 0 )); then
|
||||||
|
echo "Il faut les droit root pour executer la tache"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
SERVICEtoSTOP="apache2"
|
||||||
|
echo "Démarage d'$SERVICEtoSTOP"
|
||||||
|
service "$SERVICEtoSTOP" stop
|
|
@ -0,0 +1,23 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if (( $EUID != 0 )); then
|
||||||
|
echo "Il faut les droit root pour executer la tache"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
serviceName=mysql
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
echo "démarage de $serviceName"
|
||||||
|
action=start
|
||||||
|
;;
|
||||||
|
stop)
|
||||||
|
echo "arrêt de $serviceName"
|
||||||
|
action=stop
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "erreur $1 non reconnu"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
service $serviceName $action
|
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/bash
|
||||||
|
if (( $EUID != 0 )); then
|
||||||
|
echo "Il faut les droit root pour executer la tache"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
SERVICEtoSTART="mysql"
|
||||||
|
echo "Démarage d'$SERVICEtoSTART"
|
||||||
|
service "$SERVICEtoSTART" start
|
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/bash
|
||||||
|
if (( $EUID != 0 )); then
|
||||||
|
echo "Il faut les droit root pour executer la tache"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
SERVICEtoSTOP="mysql"
|
||||||
|
echo "Démarage d'$SERVICEtoSTOP"
|
||||||
|
service "$SERVICEtoSTOP" stop
|
|
@ -0,0 +1,32 @@
|
||||||
|
#!/bin/bash
|
||||||
|
if (( $EUID != 0 )); then
|
||||||
|
echo "Il faut les droit root pour executer la tache"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [[ $# == 3 && $1 == @(apache2|mysql) && $2 == @(apache2|mysql) ]]; then
|
||||||
|
if [ "$3" = "reload" ]
|
||||||
|
then echo "reload n'est pas une opéopération permise par mysql
|
||||||
|
Il sera donc arrêter puis démarer"
|
||||||
|
if ( service mysql stop && service mysql start )
|
||||||
|
then echo "Le service mysql à bien redémarer"
|
||||||
|
else echo "MySQL à rencotré une erreur"
|
||||||
|
fi
|
||||||
|
if ( service apache2 $3 &> /dev/null )
|
||||||
|
then echo "Le service apache à bien été recharger"
|
||||||
|
else
|
||||||
|
if ( service apache2 start )
|
||||||
|
then echo "Le service apache démare"
|
||||||
|
else
|
||||||
|
echo "Le service apache a rencontré un problème"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
elif [[ $3 == @(start|stop) ]]; then
|
||||||
|
service $1 $3
|
||||||
|
service $2 $3
|
||||||
|
echo "$1 $2 sont $3"
|
||||||
|
else
|
||||||
|
echo "$3 non reconnu"
|
||||||
|
fi
|
||||||
|
elif [[ $1 == @(apache2|mysql) && $2 == @(start|stop|reload) ]]; then
|
||||||
|
|
||||||
|
fi
|
Loading…
Reference in New Issue