Skip to content

Instantly share code, notes, and snippets.

@milosdjakonovic
Created December 29, 2014 10:41
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 milosdjakonovic/d4727b05430ef4043200 to your computer and use it in GitHub Desktop.
Save milosdjakonovic/d4727b05430ef4043200 to your computer and use it in GitHub Desktop.
Based on detected status of ProFTPD service, start undesirably stopped ProFTPD service. Intended to run AFTER cron.daily and to be workaround until Debian bug #675081 is resolved.
#!/bin/bash
RESULT="$(ps -A | grep proftpd)"
if $( echo $RESULT | grep --quiet 'proftpd' )
then
echo 'Service PROFTPD is fine, no need for action...'
else
service proftpd stop
service proftpd start
echo 'Service PROFTPD was dead, hopefully alive now.'
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment