[UPDATE] - refact deb + generate

This commit is contained in:
2022-03-17 08:50:36 +01:00
parent 192382c8c2
commit d4300b4ca5
32 changed files with 68 additions and 256 deletions
+31
View File
@@ -0,0 +1,31 @@
#!/bin/bash
source /etc/monithor-client/service.cfg
if [[ $(id -u) != "0" ]]
then
echo "Not Root"
exit
fi
if [[ "$1" == "start" ]]
then
[[ -f /tmp/endmonitor ]] && rm -f /tmp/endmonitor
rm /tmp/Monitor* /tmp/webmonithor &> /dev/null
TotalConfig=$(ls -1 /etc/monithor-client/conf/ | grep Card_.*\.cfg|wc -l)
for Conf in $(ls -1 /etc/monithor-client/conf/ | grep Card_.*\.cfg)
do
screen -dmS ${Conf} bash /usr/local/bin/monithor-client.d/MoniThor ${Conf}
done
screen -dmS webserver bash /usr/local/bin/monithor-client.d/MoniThorWebServer ${WebPort} $TotalConfig
fi
if [[ "$1" == "stop" ]]
then
killall python &> /dev/null
rm /tmp/Monithor* &> /dev/null
touch /tmp/endmonitor
fi