4
Fork 0

Added files to build Debian packages

This commit is contained in:
R3ABM Artem 2016-03-24 09:32:36 +03:00
parent 8d7562cd14
commit bdd35af00c
8 changed files with 88 additions and 0 deletions

35
debian/postinst vendored Executable file
View file

@ -0,0 +1,35 @@
#!/bin/bash
PREFIX=/opt/CronosAgent
grep master /etc/passwd > /dev/null
if [ "$?" == "1" ]
then
addgroup cronos
adduser cronos --system --home $PREFIX --shell /bin/false --disabled-login --disabled-password
fi
ps -eaf | grep root | grep systemd > /dev/null
if [ "$?" == "0" ]
then
ln -s -f $PREFIX/cronosagent.service /etc/systemd/system/multi-user.target.wants/cronosagent.service
systemctl daemon-reload
systemctl start systemd-modules-load
systemctl restart cronosagent
else
ln -s -f $PREFIX/cronosagent-daemon /etc/init.d/cronosagent
update-rc.d cronosagent defaults
service cronosagent restart
if [ -d /etc/monit/conf.d ]
then
ln -s -f $PREFIX/cronosagent-monit /etc/monit/conf.d/cronosagent
service monit restart
fi
fi
exit 0