Last active
August 29, 2015 14:26
-
-
Save jmtatsch/b7a52d17c7b0128601a1 to your computer and use it in GitHub Desktop.
telegram-daemon
This file contains hidden or 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/sh | |
### BEGIN INIT INFO | |
# Provides: telegram-daemon | |
# Required-Start: | |
# Required-Stop: | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: telegram daemon | |
# Description: telegram daemon | |
### END INIT INFO | |
# actions | |
case "$1" in | |
start) | |
echo "Telegram daemon is starting..." | |
su tatsch -c '/opt/tg/bin/telegram-cli -vvvvRC -k tg-server.pub -W -dL /var/log/telegram-daemon/telegram-daemon.log -P 2391 &' | |
echo "...done" | |
;; | |
stop) | |
echo "stopping telegram daemon..." | |
sudo pkill telegram | |
echo "..done" | |
;; | |
restart) | |
echo "stopping telegram daemon..." | |
sudo pkill telegram | |
echo "..done -- restarting..." | |
su tatsch -c '/opt/tg/bin/telegram-cli -vvvvRC -k tg-server.pub -W -dL /var/log/telegram-daemon/telegram-daemon.log -P 2391 &' | |
echo "...done" | |
;; | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment