Update mm-scripts.sh
This commit is contained in:
@@ -16,7 +16,7 @@ unset IFS
|
|||||||
OUT=`ip a show $VPN_INTERFACE up`;
|
OUT=`ip a show $VPN_INTERFACE up`;
|
||||||
|
|
||||||
MMSTART(){
|
MMSTART(){
|
||||||
|
/usr/sbin/service openvpn start
|
||||||
checked=false
|
checked=false
|
||||||
cc=0
|
cc=0
|
||||||
until [ "${checked}" = "" ]; do
|
until [ "${checked}" = "" ]; do
|
||||||
@@ -71,7 +71,6 @@ MMSTOP(){
|
|||||||
|
|
||||||
if [[ ${1} = "start" ]]; then
|
if [[ ${1} = "start" ]]; then
|
||||||
touch /opt/mm.stop
|
touch /opt/mm.stop
|
||||||
/usr/sbin/service openvpn start
|
|
||||||
MMSTART
|
MMSTART
|
||||||
|
|
||||||
elif [[ ${1} = "stop" ]]; then
|
elif [[ ${1} = "stop" ]]; then
|
||||||
@@ -93,20 +92,12 @@ fi
|
|||||||
|
|
||||||
if [ ${action-x} ]; then
|
if [ ${action-x} ]; then
|
||||||
case $action in
|
case $action in
|
||||||
start)
|
start | check)
|
||||||
touch /opt/mm.stop
|
touch /opt/mm.stop
|
||||||
MMSTART;;
|
MMSTART;;
|
||||||
stop)
|
stop)
|
||||||
touch /opt/mm.stop
|
touch /opt/mm.stop
|
||||||
MMSTOP;;
|
MMSTOP;;
|
||||||
check)
|
|
||||||
if [ ! -f /opt/mm.stop ]; then
|
|
||||||
for srvc in "${SERVICES_CHECK[@]}"; do
|
|
||||||
if [ "$(systemctl is-active ${srvc})" = "inactive" ]; then
|
|
||||||
/usr/sbin/service ${srvc} start
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
*)
|
*)
|
||||||
echo -e "Usage: ${idsCL[LightCyan]}mm${idsCL[Default]} {"
|
echo -e "Usage: ${idsCL[LightCyan]}mm${idsCL[Default]} {"
|
||||||
|
|||||||
Reference in New Issue
Block a user