This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# checking if webmin or usermin are not running | |
# In case they are not running, start them | |
declare -a units=("webmin" "usermin"); | |
for u in ${units[@]} | |
do | |
procs=`ps -Af | grep $u | grep -v 'grep\|keep-webmin-virtualmin-up.sh'`; | |
if [ -z "$procs" ] | |
then | |
echo "There is no $u procceses, so I will start it"; | |
/usr/bin/service $u start; | |
else | |
echo "$procs"; | |
fi | |
done |