This commit is contained in:
adri 2017-12-15 14:33:29 +01:00
parent ed0934435b
commit f75cf9b7af
5 changed files with 34 additions and 11 deletions

View File

@ -4,5 +4,5 @@ if (( $EUID != 0 )); then
exit
fi
SERVICEtoSTOP="apache2"
echo "Démarage d'$SERVICEtoSTOP"
service "$SERVICEtoSTOP" stop
echo "Arret d'$SERVICEtoSTOP"
service "$SERVICEtoSTOP" stop

View File

@ -1,7 +1,7 @@
#!/bin/bash
CURDate=$(date "+%Y%m%d%H%M")
FileName=$CURDate"APACHE"
FileName=$CURDate"HOME"
DIR="./"
DIRHOME=$HOME

View File

@ -4,5 +4,5 @@ if (( $EUID != 0 )); then
exit
fi
SERVICEtoSTOP="mysql"
echo "Démarage d'$SERVICEtoSTOP"
service "$SERVICEtoSTOP" stop
echo "Arret d'$SERVICEtoSTOP"
service "$SERVICEtoSTOP" stop

11
serveur
View File

@ -1,12 +1,11 @@
#!/bin/bash
LOGPATH="./serveur.log"
(
echo "DEBUT $(date +"%D %T")"
LOGPATH="/var/log/serveur.log"
if (( $EUID != 0 )); then
echo "Il faut les droit root pour executer la tache"
echo "FIN $(date +"%D %T")"
echo "$(date +"%D %T") : ERREUR : Il faut les droit root pour executer la tache"
exit 1
fi
(
echo "DEBUT $(date +"%D %T")"
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
@ -48,4 +47,4 @@ elif [[ $1 == @(apache2|mysql) && $2 == @(start|stop|reload) ]]; then
esac
fi
echo "FIN $(date +"%D %T")"
) 2>&2 | tee -a $LOGPATH
) 2>&1 | tee -a $LOGPATH

View File

@ -31,3 +31,27 @@ reload n'est pas une opéopération permise par mysql
Le service mysql à bien redémarer
Le service apache à bien été recharger
FIN 12/13/17 11:37:04
DEBUT 12/14/17 13:33:20
apache2 mysql sont start
FIN 12/14/17 13:33:22
DEBUT 12/14/17 13:33:35
apache2 mysql sont stop
FIN 12/14/17 13:33:37
DEBUT 12/14/17 13:34:15
SUCCESS : apache2 start
FIN 12/14/17 13:34:15
DEBUT 12/14/17 13:34:22
SUCCESS : apache2 stop
FIN 12/14/17 13:34:22
DEBUT 12/14/17 13:34:30
SUCCESS : mysql stop
FIN 12/14/17 13:34:30
DEBUT 12/14/17 13:34:38
SUCCESS : mysql start
FIN 12/14/17 13:34:39
DEBUT 12/14/17 13:34:48
SUCCESS : mysql stop
FIN 12/14/17 13:34:51
DEBUT 12/14/17 13:34:55
SUCCESS : mysql stop
FIN 12/14/17 13:34:55