diff options
author | Renato Botelho <renato@netgate.com> | 2016-06-23 08:26:30 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2016-06-23 08:26:30 -0300 |
commit | 2089cc2cca39b046eecb62de5c56e070e16bc94c (patch) | |
tree | 3a1a0c36edfcbeea002aa6b0426d6f163f236aaf /src/usr/local/sbin | |
parent | 9a17d2938055e5d12f36f9efc332548a780c464f (diff) | |
download | pfsense-2089cc2cca39b046eecb62de5c56e070e16bc94c.zip pfsense-2089cc2cca39b046eecb62de5c56e070e16bc94c.tar.gz |
Move athctrl.sh to /usr/local/sbin
Diffstat (limited to 'src/usr/local/sbin')
-rwxr-xr-x | src/usr/local/sbin/athctrl.sh | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/usr/local/sbin/athctrl.sh b/src/usr/local/sbin/athctrl.sh new file mode 100755 index 0000000..6ba35ff --- /dev/null +++ b/src/usr/local/sbin/athctrl.sh @@ -0,0 +1,41 @@ +#!/bin/sh +# +# Set the IFS parameters for an interface configured for +# point-to-point use at a specific distance. Based on a +# program by Gunter Burchardt. +# +DEV=ath0 +d=0 + +usage() +{ + echo "Usage: $0 [-i athX] [-d meters]" + exit 2 +} + +args=`getopt d:i: $*` +test $? -ne 0 && usage + +set -- $args +for i; do + case "$i" in + -i) DEV="$2"; shift; shift;; + -d) d="$2"; shift; shift;; + --) shift; break; + esac +done + +test $d -eq 0 && usage + +slottime=`expr 9 + \( $d / 300 \)` +if expr \( $d % 300 \) != 0 >/dev/null 2>&1; then + slottime=`expr $slottime + 1` +fi +timeout=`expr $slottime \* 2 + 3` + +printf "Setup IFS parameters on interface ${DEV} for %i meter p-2-p link\n" $d +ATHN=`echo $DEV | sed 's/ath//'` +sysctl dev.ath.$ATHN.slottime=$slottime +sysctl dev.ath.$ATHN.acktimeout=$timeout +sysctl dev.ath.$ATHN.ctstimeout=$timeout + |