Created
April 29, 2019 14:51
-
-
Save altmas5/ec15436bd66c6fd26646a71585c23ca0 to your computer and use it in GitHub Desktop.
Keep usermin and webmin (virtualmin) up
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment