From 9d1232228b9b63f6b20389ac0a481d0eb25713b8 Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Mon, 22 Mar 2021 21:12:24 +0300 Subject: move MODEM_IP variable to a separate file --- config.sh | 4 ++++ e3372-clear-traffic-stats.sh | 6 ++++-- e3372-dataswitch-off.sh | 6 ++++-- e3372-dataswitch-on.sh | 6 ++++-- e3372-dhcp-setting.sh | 6 ++++-- e3372-readsms-xmlstarlet.sh | 4 +++- e3372-readsms.sh | 6 ++++-- e3372-reboot.sh | 6 ++++-- e3372-sendsms.sh | 6 ++++-- e3372-stats.sh | 6 ++++-- e3372.sh | 6 ++++-- 11 files changed, 43 insertions(+), 19 deletions(-) create mode 100755 config.sh mode change 100644 => 100755 e3372-clear-traffic-stats.sh mode change 100644 => 100755 e3372-dataswitch-off.sh mode change 100644 => 100755 e3372-dataswitch-on.sh mode change 100644 => 100755 e3372-dhcp-setting.sh mode change 100644 => 100755 e3372-readsms-xmlstarlet.sh mode change 100644 => 100755 e3372-readsms.sh mode change 100644 => 100755 e3372-reboot.sh mode change 100644 => 100755 e3372-sendsms.sh mode change 100644 => 100755 e3372-stats.sh mode change 100644 => 100755 e3372.sh diff --git a/config.sh b/config.sh new file mode 100755 index 0000000..fba78b7 --- /dev/null +++ b/config.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +[ -z "$MODEM_IP" ] && MODEM_IP="192.168.9.1" \ No newline at end of file diff --git a/e3372-clear-traffic-stats.sh b/e3372-clear-traffic-stats.sh old mode 100644 new mode 100755 index c8402ca..7874f86 --- a/e3372-clear-traffic-stats.sh +++ b/e3372-clear-traffic-stats.sh @@ -1,6 +1,8 @@ -#!/bin/sh +#!/bin/bash + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +. "$DIR/config.sh" -MODEM_IP="192.168.9.1" curl -s -X GET "http://$MODEM_IP/api/webserver/SesTokInfo" > ses_tok.xml COOKIE=`grep "SessionID=" ses_tok.xml | cut -b 10-147` TOKEN=`grep "TokInfo" ses_tok.xml | cut -b 10-41` diff --git a/e3372-dataswitch-off.sh b/e3372-dataswitch-off.sh old mode 100644 new mode 100755 index 8fcc5a7..369fc1e --- a/e3372-dataswitch-off.sh +++ b/e3372-dataswitch-off.sh @@ -1,6 +1,8 @@ -#!/bin/sh +#!/bin/bash + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +. "$DIR/config.sh" -MODEM_IP="192.168.9.1" curl -s -X GET "http://$MODEM_IP/api/webserver/SesTokInfo" > ses_tok.xml COOKIE=`grep "SessionID=" ses_tok.xml | cut -b 10-147` TOKEN=`grep "TokInfo" ses_tok.xml | cut -b 10-41` diff --git a/e3372-dataswitch-on.sh b/e3372-dataswitch-on.sh old mode 100644 new mode 100755 index 6b9e699..8fc0de7 --- a/e3372-dataswitch-on.sh +++ b/e3372-dataswitch-on.sh @@ -1,6 +1,8 @@ -#!/bin/sh +#!/bin/bash + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +. "$DIR/config.sh" -MODEM_IP="192.168.9.1" curl -s -X GET "http://$MODEM_IP/api/webserver/SesTokInfo" > ses_tok.xml COOKIE=`grep "SessionID=" ses_tok.xml | cut -b 10-147` TOKEN=`grep "TokInfo" ses_tok.xml | cut -b 10-41` diff --git a/e3372-dhcp-setting.sh b/e3372-dhcp-setting.sh old mode 100644 new mode 100755 index ed9e2d1..d108468 --- a/e3372-dhcp-setting.sh +++ b/e3372-dhcp-setting.sh @@ -1,6 +1,8 @@ -#!/bin/sh +#!/bin/bash + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +. "$DIR/config.sh" -MODEM_IP="192.168.9.1" curl -s -X GET "http://$MODEM_IP/api/webserver/SesTokInfo" > ses_tok.xml COOKIE=`grep "SessionID=" ses_tok.xml | cut -b 10-147` TOKEN=`grep "TokInfo" ses_tok.xml | cut -b 10-41` diff --git a/e3372-readsms-xmlstarlet.sh b/e3372-readsms-xmlstarlet.sh old mode 100644 new mode 100755 index c25e94b..6b20af7 --- a/e3372-readsms-xmlstarlet.sh +++ b/e3372-readsms-xmlstarlet.sh @@ -1,6 +1,8 @@ #!/bin/bash -MODEM_IP="192.168.9.1" +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +. "$DIR/config.sh" + curl -s -X GET "http://$MODEM_IP/api/webserver/SesTokInfo" > ses_tok.xml COOKIE=`grep "SessionID=" ses_tok.xml | cut -b 10-147` TOKEN=`grep "TokInfo" ses_tok.xml | cut -b 10-41` diff --git a/e3372-readsms.sh b/e3372-readsms.sh old mode 100644 new mode 100755 index 38d980f..4191bd1 --- a/e3372-readsms.sh +++ b/e3372-readsms.sh @@ -1,6 +1,8 @@ -#!/bin/sh +#!/bin/bash + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +. "$DIR/config.sh" -MODEM_IP="192.168.9.1" curl -s -X GET "http://$MODEM_IP/api/webserver/SesTokInfo" > ses_tok.xml COOKIE=`grep "SessionID=" ses_tok.xml | cut -b 10-147` TOKEN=`grep "TokInfo" ses_tok.xml | cut -b 10-41` diff --git a/e3372-reboot.sh b/e3372-reboot.sh old mode 100644 new mode 100755 index 9baf1a2..0f648fd --- a/e3372-reboot.sh +++ b/e3372-reboot.sh @@ -1,6 +1,8 @@ -#!/bin/sh +#!/bin/bash + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +. "$DIR/config.sh" -MODEM_IP="192.168.9.1" curl -s -X GET "http://$MODEM_IP/api/webserver/SesTokInfo" > ses_tok.xml COOKIE=`grep "SessionID=" ses_tok.xml | cut -b 10-147` TOKEN=`grep "TokInfo" ses_tok.xml | cut -b 10-41` diff --git a/e3372-sendsms.sh b/e3372-sendsms.sh old mode 100644 new mode 100755 index e79f77a..ab1fbef --- a/e3372-sendsms.sh +++ b/e3372-sendsms.sh @@ -1,6 +1,8 @@ -#!/bin/sh +#!/bin/bash + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +. "$DIR/config.sh" -MODEM_IP="192.168.9.1" curl -s -X GET "http://$MODEM_IP/api/webserver/SesTokInfo" > ses_tok.xml COOKIE=`grep "SessionID=" ses_tok.xml | cut -b 10-147` TOKEN=`grep "TokInfo" ses_tok.xml | cut -b 10-41` diff --git a/e3372-stats.sh b/e3372-stats.sh old mode 100644 new mode 100755 index e0494e9..d798a22 --- a/e3372-stats.sh +++ b/e3372-stats.sh @@ -1,6 +1,8 @@ -#!/bin/sh +#!/bin/bash + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +. "$DIR/config.sh" -MODEM_IP="192.168.9.1" curl -s -X GET "http://$MODEM_IP/api/webserver/SesTokInfo" > ses_tok.xml COOKIE=`grep "SessionID=" ses_tok.xml | cut -b 10-147` TOKEN=`grep "TokInfo" ses_tok.xml | cut -b 10-41` diff --git a/e3372.sh b/e3372.sh old mode 100644 new mode 100755 index d06ec84..5837075 --- a/e3372.sh +++ b/e3372.sh @@ -1,6 +1,8 @@ -#!/bin/sh +#!/bin/bash + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +. "$DIR/config.sh" -MODEM_IP="192.168.9.1" curl -s -X GET "http://$MODEM_IP/api/webserver/SesTokInfo" > ses_tok.xml COOKIE=`grep "SessionID=" ses_tok.xml | cut -b 10-147` TOKEN=`grep "TokInfo" ses_tok.xml | cut -b 10-41` -- cgit v1.2.3