author | benmeyer <benmeyer> | 2002-10-29 16:11:39 (UTC) |
---|---|---|
committer | benmeyer <benmeyer> | 2002-10-29 16:11:39 (UTC) |
commit | 2c3aa49e64a63f475bd60707c8cc105829691ab1 (patch) (side-by-side diff) | |
tree | 016296ff6ae9857cd1fc53ed43db4c5fe6937e08 /noncore | |
parent | e63cecc3821eda0cb3ace99479112d68bdc023e6 (diff) | |
download | opie-2c3aa49e64a63f475bd60707c8cc105829691ab1.zip opie-2c3aa49e64a63f475bd60707c8cc105829691ab1.tar.gz opie-2c3aa49e64a63f475bd60707c8cc105829691ab1.tar.bz2 |
changed the name so *.sh
-rw-r--r-- | noncore/net/networksetup/interfaces/changedns | 111 | ||||
-rw-r--r-- | noncore/settings/networksettings/interfaces/changedns | 111 |
2 files changed, 0 insertions, 222 deletions
diff --git a/noncore/net/networksetup/interfaces/changedns b/noncore/net/networksetup/interfaces/changedns deleted file mode 100644 index 4760a67..0000000 --- a/noncore/net/networksetup/interfaces/changedns +++ b/dev/null @@ -1,111 +0,0 @@ -#!/bin/bash - -SN="`basename $0`" # base portion of our filename -AE="-a" # switch to add an entry -RE="-r" # swithc to remove an entry -EL="/tmp/resolv.conf" # expected location of the system nameserver config file -ARGS="$@" # friendly variable name for all args - -usage(){ - echo "usage: -$SN -a {ip} [{ip}...] -$SN -r {ip} [{ip}...]" -} - -#if are there at least two arguments? -if [ "$#" -gt 1 ] -then - - #remove any old resolv.conf file - rm .resolve.conf .resolve.old .resolve.new 2> /dev/null - - #cast current nameserver file into OLD - cat "$EL" > .resolve.old - - #build IP list - for ARG in $ARGS - do - if [ "$ARG" != "$1" ] - then - IP_LIST=`echo "$IP_LIST $ARG"` - fi - done - - #select case on first switch - case "$1" in - - #case '-a' - "$AE" ) - - #for each IP in IP_LIST - for IP in $IP_LIST - do - #add nameserver entery to .newfile - echo "nameserver $IP" >> .resolve.conf - - #cat OLD into grep excluding IP lines, - #storing results into NEW - cat .resolve.old | grep -v "$IP" > .resolve.new - - #set OLD to NEW - cat .resolve.new > .resolve.old - - done - - #cat OLD onto end of .newfile - cat .resolve.new >> .resolve.conf - - #clean up work files - rm .resolve.new .resolve.old - - #move old conf file to old conf file.bak - mv "$EL" "$EL.bak" - - #move .newfile to resolve.conf file - mv .resolve.conf "$EL" - - echo "Added $IP_LIST to $EL" - ;; - - #case '-r' - "$RE" ) - - #for each IP in IP_LIST - for IP in $IP_LIST - do - #cat OLD into grep excluding IP lines, - #storing results into NEW - cat .resolve.old | grep -v "$IP" > .resolve.new - - #set OLD to NEW - cat .resolve.new > .resolve.old - - done - - #move old conf file to old conf file.bak - mv "$EL" "$EL.bak" - - #move .newfile to resolve.conf file - mv .resolve.new "$EL" - - echo "Removed $IP_LIST from $EL" - - ;; - - #case else - * ) - - usage - ;; - - - #end switch - esac - -#else -else - - usage - -#end -fi diff --git a/noncore/settings/networksettings/interfaces/changedns b/noncore/settings/networksettings/interfaces/changedns deleted file mode 100644 index 4760a67..0000000 --- a/noncore/settings/networksettings/interfaces/changedns +++ b/dev/null @@ -1,111 +0,0 @@ -#!/bin/bash - -SN="`basename $0`" # base portion of our filename -AE="-a" # switch to add an entry -RE="-r" # swithc to remove an entry -EL="/tmp/resolv.conf" # expected location of the system nameserver config file -ARGS="$@" # friendly variable name for all args - -usage(){ - echo "usage: -$SN -a {ip} [{ip}...] -$SN -r {ip} [{ip}...]" -} - -#if are there at least two arguments? -if [ "$#" -gt 1 ] -then - - #remove any old resolv.conf file - rm .resolve.conf .resolve.old .resolve.new 2> /dev/null - - #cast current nameserver file into OLD - cat "$EL" > .resolve.old - - #build IP list - for ARG in $ARGS - do - if [ "$ARG" != "$1" ] - then - IP_LIST=`echo "$IP_LIST $ARG"` - fi - done - - #select case on first switch - case "$1" in - - #case '-a' - "$AE" ) - - #for each IP in IP_LIST - for IP in $IP_LIST - do - #add nameserver entery to .newfile - echo "nameserver $IP" >> .resolve.conf - - #cat OLD into grep excluding IP lines, - #storing results into NEW - cat .resolve.old | grep -v "$IP" > .resolve.new - - #set OLD to NEW - cat .resolve.new > .resolve.old - - done - - #cat OLD onto end of .newfile - cat .resolve.new >> .resolve.conf - - #clean up work files - rm .resolve.new .resolve.old - - #move old conf file to old conf file.bak - mv "$EL" "$EL.bak" - - #move .newfile to resolve.conf file - mv .resolve.conf "$EL" - - echo "Added $IP_LIST to $EL" - ;; - - #case '-r' - "$RE" ) - - #for each IP in IP_LIST - for IP in $IP_LIST - do - #cat OLD into grep excluding IP lines, - #storing results into NEW - cat .resolve.old | grep -v "$IP" > .resolve.new - - #set OLD to NEW - cat .resolve.new > .resolve.old - - done - - #move old conf file to old conf file.bak - mv "$EL" "$EL.bak" - - #move .newfile to resolve.conf file - mv .resolve.new "$EL" - - echo "Removed $IP_LIST from $EL" - - ;; - - #case else - * ) - - usage - ;; - - - #end switch - esac - -#else -else - - usage - -#end -fi |