Configure and install upstart script
This commit is contained in:
parent
8775f720a6
commit
3de95880f8
@ -53,5 +53,9 @@ $ cd $HOME
|
|||||||
$ git clone https://github.com/yagop/telegram-bot.git --recursive
|
$ git clone https://github.com/yagop/telegram-bot.git --recursive
|
||||||
$ cd telegram-bot/tg
|
$ cd telegram-bot/tg
|
||||||
$ ./configure && make
|
$ ./configure && make
|
||||||
$ cd .. && ./launch.sh # Will ask you for a phone number & confirmation code.
|
$ cd ..
|
||||||
|
$ sed -i "s/yourusername/$(whoami)/g" etc/telegram.conf
|
||||||
|
$ sed -i "s_telegrambotpath_$(pwd)_g" etc/telegram.conf
|
||||||
|
$ sudo cp etc/telegram.conf /etc/init/
|
||||||
|
$ ./launch.sh # Will ask you for a phone number & confirmation code.
|
||||||
```
|
```
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
|
description "Telegram-bot upstart script"
|
||||||
|
|
||||||
respawn
|
respawn
|
||||||
respawn limit 15 5
|
respawn limit 15 5
|
||||||
|
|
||||||
start on runlevel [2345]
|
start on runlevel [2345]
|
||||||
stop on shutdown
|
stop on shutdown
|
||||||
|
|
||||||
script
|
setuid yourusername
|
||||||
exec su -s /bin/sh -c /home/yperez/develop/telegram-bot/launch.sh yperez
|
exec /bin/sh telegrambotpath/launch.sh
|
||||||
end script
|
|
||||||
|
Reference in New Issue
Block a user