diff options
author | Jesse Gilles <jgilles@multitech.com> | 2013-12-18 16:14:37 -0600 |
---|---|---|
committer | Jesse Gilles <jgilles@multitech.com> | 2013-12-18 16:14:37 -0600 |
commit | b034563347d34f7e9062dd50bc0a10b810837696 (patch) | |
tree | ca8683328c12f168b4e9cc907009ca8bf428610b /multitech/recipes/ocg-scripts/ocg-scripts-1.0/ocg-set-apn | |
parent | 9ce0e4e887b2ab1b25de3cd41a3f733d3779a7bf (diff) |
ocg-scripts: add ocg-cell-router, ocg-set-apn, remove .sh from others
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 | 19 |
1 files changed, 19 insertions, 0 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 new file mode 100755 index 0000000..867c24e --- /dev/null +++ b/multitech/recipes/ocg-scripts/ocg-scripts-1.0/ocg-set-apn @@ -0,0 +1,19 @@ +#!/bin/bash + +if [[ $# != "1" ]]; then + echo "Usage: $(basename $0) APN" + exit 1 +fi + +apn=$1 + +sed -r -i "s/^OK\s+'AT\+CGDCONT=1,\"IP\",\"[^\"]*\"'$/OK 'AT\+CGDCONT=1,\"IP\",\"${apn}\"'/" /etc/ppp/peers/gsm_chat + +if [[ $? != "0" ]]; then + echo "Failed to change APN" + exit 1 +else + echo "Set APN to \"${apn}\"" +fi + +exit 0 |