Skip to content

Instantly share code, notes, and snippets.

@altmas5
Created April 29, 2019 14:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save altmas5/ec15436bd66c6fd26646a71585c23ca0 to your computer and use it in GitHub Desktop.
Save altmas5/ec15436bd66c6fd26646a71585c23ca0 to your computer and use it in GitHub Desktop.
Keep usermin and webmin (virtualmin) up
#!/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