Skip to content

Instantly share code, notes, and snippets.

@glamrock
Last active April 5, 2016 22:06
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 glamrock/77c9d22b6780899604dd2baebfa5f6d9 to your computer and use it in GitHub Desktop.
Save glamrock/77c9d22b6780899604dd2baebfa5f6d9 to your computer and use it in GitHub Desktop.
cron job to detect if tor is up and if it isn't, to start the process
#!/bin/bash
# 10/10 janky af
time=$(date)
tor=$(tor runasdaemon 1)
if pgrep -x "tor" > /dev/null
then echo "$time" >> torlogup.txt
else
$tor #run tor
echo "$time" >> tordownlog.txt
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment