Install horst for wifi network monitoring
This commit is contained in:
parent
cc414b84ad
commit
c6ab0b0cb7
|
@ -735,6 +735,9 @@ function configure_user_interface {
|
|||
# a sane editor
|
||||
chroot "$rootdir" apt-get -y install emacs24
|
||||
|
||||
# for wifi monitoring
|
||||
chroot "$rootdir" apt-get -y install horst
|
||||
|
||||
# for sound level control
|
||||
chroot "$rootdir" apt-get -y install alsa-utils
|
||||
|
||||
|
|
|
@ -260,6 +260,38 @@ function start {
|
|||
verify
|
||||
}
|
||||
|
||||
function monitor {
|
||||
if [ -z "$IFACE" ] ; then
|
||||
echo 'error: unable to find wifi interface, not enabling batman-adv mesh'
|
||||
exit 723657
|
||||
fi
|
||||
|
||||
stop
|
||||
|
||||
echo "info: monitoring mesh network $WIFI_SSID on $IFACE"
|
||||
|
||||
systemctl stop network-manager
|
||||
sleep 5
|
||||
|
||||
global_rate_limit
|
||||
|
||||
# Might have to re-enable wifi
|
||||
rfkill unblock $(rfkill list|awk -F: "/phy/ {print $1}") || true
|
||||
|
||||
ifconfig $IFACE down
|
||||
ifconfig $IFACE mtu 1532
|
||||
ifconfig $IFACE hw ether $(assign_peer_address)
|
||||
iwconfig $IFACE enc off
|
||||
iwconfig $IFACE mode monitor channel $CHANNEL
|
||||
sleep 1
|
||||
iwconfig $IFACE ap $CELLID
|
||||
|
||||
modprobe batman-adv
|
||||
batctl if add $IFACE
|
||||
ifconfig $IFACE up
|
||||
horst -i $IFACE
|
||||
}
|
||||
|
||||
if ! grep -q "$IFACE" /proc/net/dev; then
|
||||
echo 'Interface $IFACE was not found'
|
||||
stop
|
||||
|
@ -267,7 +299,7 @@ if ! grep -q "$IFACE" /proc/net/dev; then
|
|||
fi
|
||||
|
||||
case "$1" in
|
||||
start|stop|status)
|
||||
start|stop|status|monitor)
|
||||
$1
|
||||
;;
|
||||
restart)
|
||||
|
|
Loading…
Reference in New Issue