diff options
-rwxr-xr-x | config.sh | 4 | ||||
-rwxr-xr-x[-rw-r--r--] | e3372-clear-traffic-stats.sh | 6 | ||||
-rwxr-xr-x[-rw-r--r--] | e3372-dataswitch-off.sh | 6 | ||||
-rwxr-xr-x[-rw-r--r--] | e3372-dataswitch-on.sh | 6 | ||||
-rwxr-xr-x[-rw-r--r--] | e3372-dhcp-setting.sh | 6 | ||||
-rwxr-xr-x[-rw-r--r--] | e3372-readsms-xmlstarlet.sh | 4 | ||||
-rwxr-xr-x[-rw-r--r--] | e3372-readsms.sh | 6 | ||||
-rwxr-xr-x[-rw-r--r--] | e3372-reboot.sh | 6 | ||||
-rwxr-xr-x[-rw-r--r--] | e3372-sendsms.sh | 6 | ||||
-rwxr-xr-x[-rw-r--r--] | e3372-stats.sh | 6 | ||||
-rwxr-xr-x[-rw-r--r--] | e3372.sh | 6 |
11 files changed, 43 insertions, 19 deletions
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 index c8402ca..7874f86 100644..100755 --- 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 index 8fcc5a7..369fc1e 100644..100755 --- 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 index 6b9e699..8fc0de7 100644..100755 --- 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 index ed9e2d1..d108468 100644..100755 --- 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 index c25e94b..6b20af7 100644..100755 --- 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 index 38d980f..4191bd1 100644..100755 --- 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 index 9baf1a2..0f648fd 100644..100755 --- 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 index e79f77a..ab1fbef 100644..100755 --- 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 index e0494e9..d798a22 100644..100755 --- 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` @@ -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` |