diff options
author | Jesse Gilles <jgilles@multitech.com> | 2013-12-20 15:09:49 -0600 |
---|---|---|
committer | Jesse Gilles <jgilles@multitech.com> | 2013-12-20 15:09:49 -0600 |
commit | c44aebe7016921035c41a95cd8989d55c2eb59a9 (patch) | |
tree | 4d01d0c2ea3b9f553c858ea8e4f4bacce855b283 /multitech/recipes/ocg-scripts/ocg-scripts-1.0/ocg-set-apn | |
parent | e7f7fd594fe8974efc97f02884113b134617f854 (diff) |
ocg-scripts: updated scripts with more options
ocg-cell-router: configurable LAN and WAN interface options
ocg-wifi-ap: dhcpd config enhancements, bridge interface configurable
Diffstat (limited to 'multitech/recipes/ocg-scripts/ocg-scripts-1.0/ocg-set-apn')
-rwxr-xr-x | multitech/recipes/ocg-scripts/ocg-scripts-1.0/ocg-set-apn | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/multitech/recipes/ocg-scripts/ocg-scripts-1.0/ocg-set-apn b/multitech/recipes/ocg-scripts/ocg-scripts-1.0/ocg-set-apn index 867c24e..5c3985f 100755 --- a/multitech/recipes/ocg-scripts/ocg-scripts-1.0/ocg-set-apn +++ b/multitech/recipes/ocg-scripts/ocg-scripts-1.0/ocg-set-apn @@ -1,19 +1,20 @@ #!/bin/bash -if [[ $# != "1" ]]; then +if [[ $# != 1 ]]; then echo "Usage: $(basename $0) APN" exit 1 fi apn=$1 +chat_file=/etc/ppp/peers/gsm_chat -sed -r -i "s/^OK\s+'AT\+CGDCONT=1,\"IP\",\"[^\"]*\"'$/OK 'AT\+CGDCONT=1,\"IP\",\"${apn}\"'/" /etc/ppp/peers/gsm_chat +sed -r -i "s/^OK\s+'AT\+CGDCONT=1,\"IP\",\"[^\"]*\"'$/OK 'AT\+CGDCONT=1,\"IP\",\"${apn}\"'/" $chat_file -if [[ $? != "0" ]]; then +if [[ $? != 0 ]]; then echo "Failed to change APN" exit 1 else - echo "Set APN to \"${apn}\"" + echo "Set APN to \"${apn}\" in $chat_file" fi exit 0 |