Project

General

Profile

« Previous | Next » 

Revision 2089cc2c

Added by Renato Botelho about 9 years ago

Move athctrl.sh to /usr/local/sbin

View differences:

src/etc/inc/interfaces.inc
2870 2870
	/* set ack timers according to users preference (if he/she has any) */
2871 2871
	if ($distance) {
2872 2872
		fwrite($fd_set, "# Enable ATH distance settings\n");
2873
		fwrite($fd_set, "/sbin/athctrl.sh -i {$baseif} -d {$distance}\n");
2873
		fwrite($fd_set, "/usr/local/sbin/athctrl.sh -i {$baseif} -d {$distance}\n");
2874 2874
	}
2875 2875

  
2876 2876
	if (isset($wlcfg['wpa']['enable'])) {
src/etc/pfSense.obsoletedfiles
166 166
/lib/libz.so.5
167 167
/root/latest.tgz.sha256
168 168
/sbin/atacontrol
169
/sbin/athctrl.sh
169 170
/sbin/idmapd
170 171
/sbin/ip6fw
171 172
/sbin/mount_devfs
src/sbin/athctrl.sh
1
#!/bin/sh
2
#
3
# Set the IFS parameters for an interface configured for
4
# point-to-point use at a specific distance.  Based on a
5
# program by Gunter Burchardt.
6
#
7
DEV=ath0
8
d=0
9

  
10
usage()
11
{
12
	echo "Usage: $0 [-i athX] [-d meters]"
13
	exit 2
14
}
15

  
16
args=`getopt d:i: $*`
17
test $? -ne 0 && usage
18

  
19
set -- $args
20
for i; do
21
	case "$i" in
22
	-i)	DEV="$2"; shift; shift;;
23
	-d)	d="$2"; shift; shift;;
24
	--)	shift; break;
25
	esac
26
done
27

  
28
test $d -eq 0 && usage
29

  
30
slottime=`expr 9 + \( $d / 300 \)`
31
if expr \( $d % 300 \) != 0 >/dev/null 2>&1; then
32
	slottime=`expr $slottime + 1`
33
fi
34
timeout=`expr $slottime \* 2 + 3`
35

  
36
printf "Setup IFS parameters on interface ${DEV} for %i meter p-2-p link\n" $d
37
ATHN=`echo $DEV | sed 's/ath//'`
38
sysctl dev.ath.$ATHN.slottime=$slottime
39
sysctl dev.ath.$ATHN.acktimeout=$timeout
40
sysctl dev.ath.$ATHN.ctstimeout=$timeout
41

  
src/usr/local/sbin/athctrl.sh
1
#!/bin/sh
2
#
3
# Set the IFS parameters for an interface configured for
4
# point-to-point use at a specific distance.  Based on a
5
# program by Gunter Burchardt.
6
#
7
DEV=ath0
8
d=0
9

  
10
usage()
11
{
12
	echo "Usage: $0 [-i athX] [-d meters]"
13
	exit 2
14
}
15

  
16
args=`getopt d:i: $*`
17
test $? -ne 0 && usage
18

  
19
set -- $args
20
for i; do
21
	case "$i" in
22
	-i)	DEV="$2"; shift; shift;;
23
	-d)	d="$2"; shift; shift;;
24
	--)	shift; break;
25
	esac
26
done
27

  
28
test $d -eq 0 && usage
29

  
30
slottime=`expr 9 + \( $d / 300 \)`
31
if expr \( $d % 300 \) != 0 >/dev/null 2>&1; then
32
	slottime=`expr $slottime + 1`
33
fi
34
timeout=`expr $slottime \* 2 + 3`
35

  
36
printf "Setup IFS parameters on interface ${DEV} for %i meter p-2-p link\n" $d
37
ATHN=`echo $DEV | sed 's/ath//'`
38
sysctl dev.ath.$ATHN.slottime=$slottime
39
sysctl dev.ath.$ATHN.acktimeout=$timeout
40
sysctl dev.ath.$ATHN.ctstimeout=$timeout
41

  

Also available in: Unified diff