[UPDATE] Check IP service
This commit is contained in:
parent
176c779dfd
commit
ec27b17ed6
@ -1,12 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
source /etc/monithor-client/service.cfg
|
||||
if [[ $(id -u) != "0" ]]
|
||||
then
|
||||
echo "Not Root"
|
||||
exit
|
||||
Ip=$(echo $RemoteIp| cut -d":" -f1)
|
||||
|
||||
Exit () {
|
||||
|
||||
[[ "$1" == "root" ]] && echo "You have to be root ..."
|
||||
[[ "$1" == "Config" ]] && echo "Ip configuration will failed"
|
||||
|
||||
exit
|
||||
}
|
||||
|
||||
if [[ $(id -u) != "0" ]]
|
||||
then
|
||||
Exit root
|
||||
fi
|
||||
|
||||
[[ ! -z $(ifconfig | grep inet | awk '{print $2}' | grep $LocalIp) ]] && Exit Config
|
||||
|
||||
if [[ "$1" == "start" ]]
|
||||
then
|
||||
|
||||
@ -5,12 +5,21 @@ ScriptDir=/usr/local/bin/monithor-server.d/
|
||||
SondeFile=/etc/monithor-server/sonde.cfg
|
||||
source /etc/monithor-server/service.cfg
|
||||
|
||||
Exit () {
|
||||
|
||||
[[ "$1" == "root" ]] && echo "You have to be root ..."
|
||||
[[ "$1" == "Config" ]] && echo "Ip configuration will failed"
|
||||
|
||||
exit
|
||||
}
|
||||
|
||||
if [[ $(id -u) != "0" ]]
|
||||
then
|
||||
echo "Not Root"
|
||||
exit
|
||||
Exit root
|
||||
fi
|
||||
|
||||
[[ ! -z $(ifconfig | grep inet | awk '{print $2}' | grep $LocalIp) ]] && Exit Config
|
||||
|
||||
|
||||
|
||||
[[ "${Crypted}" == "yes" ]] && NcCmd="cryptcat -k ${LocalPassword} -l ${LocalIp} -p ${LocalPort} " || NcCmd="nc -l ${LocalIp} ${LocalPort}"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user