[UPDATE] - refact deb + generate
This commit is contained in:
+31
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user