Add preinst and postrm for daemon mode

Generate config
This commit is contained in:
Steve Illichevskiy 2014-10-02 20:52:22 +04:00
parent 0917afe134
commit f159bd954a
3 changed files with 25 additions and 0 deletions

3
debian/install vendored
View File

@ -1,2 +1,5 @@
bin/telegram-cli usr/bin
bin/telegram-cli usr/share/telegram-daemon/bin
start-telegram-daemon /usr/share/telegram-daemon/bin
test.lua /var/lib/telegram-daemon/
server.pub etc/telegram-cli

4
debian/postrm vendored Normal file
View File

@ -0,0 +1,4 @@
#!/bin/sh
deluser telegramd
rm -r /etc/telegram-daemon/
rm -r /var/log/telegram-daemon/

18
debian/preinst vendored Normal file
View File

@ -0,0 +1,18 @@
#!/bin/sh
adduser --system --home /var/lib/telegram-daemon/ telegramd
usermod -c "Telegram Daemon" telegramd
usermod -d "/var/lib/telegram-daemon/" telegramd
usermod -g "telegramd" telegramd
usermod -s "/bin/false" telegramd
mkdir /etc/telegram-daemon/
mkdir /var/log/telegram-daemon/
touch /etc/telegram-daemon/telegram-daemon.achat.conf
echo "execute telegram-cli" > /etc/telegram-daemon/telegram-daemon.achat.conf
echo "-d" >> /etc/telegram-daemon/telegram-daemon.achat.conf
echo "-vvvv" >> /etc/telegram-daemon/telegram-daemon.achat.conf
echo "-E" >> /etc/telegram-daemon/telegram-daemon.achat.conf
echo "-R" >> /etc/telegram-daemon/telegram-daemon.achat.conf
echo "-D" >> /etc/telegram-daemon/telegram-daemon.achat.conf
echo "-C" >> /etc/telegram-daemon/telegram-daemon.achat.conf
echo "-P 2391" >> /etc/telegram-daemon/telegram-daemon.achat.conf