Skip to content

Instantly share code, notes, and snippets.

@kemitche
Created October 23, 2014 19:37
Show Gist options
  • Save kemitche/701cb8da5760a53f0dc5 to your computer and use it in GitHub Desktop.
Save kemitche/701cb8da5760a53f0dc5 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ "$1" == "list" ]; then
if [ "$2" == "all" ]; then
sudo initctl list | grep reddit
else
sudo initctl list | grep reddit | grep 'start/running'
fi
exit;
fi
if [ "$1" == "shell" ]; then
cd /home/reddit/public/r2
exec paster shell run.ini
exit;
fi
if [ "$1" == "log" ]; then
exec sudo tail -f /var/log/upstart/reddit-paster.log
exit;
fi
sudo initctl emit reddit-$1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment