61 lines
1.6 KiB
Bash
61 lines
1.6 KiB
Bash
#!/bin/bash
|
|
help () {
|
|
echo "Supernode Settings:"
|
|
echo "status | off | on | backup | backup_off"
|
|
}
|
|
|
|
status () {
|
|
supernode_status=$(/bin/cat /etc/supernode-status/supernode.status)
|
|
supernode_mode=$(/bin/cat /etc/supernode-status/supernode.mode)
|
|
|
|
echo -e "\nSupernode Status: (Ist-Zustand)"
|
|
if [ $supernode_status == 0 ]; then
|
|
echo "Supernode ist Abgeschaltet"
|
|
elif [ $supernode_status == 1 ]; then
|
|
echo "Supernode läuft (Automatik inkl. Backup)"
|
|
elif [ $supernode_status == 2 ]; then
|
|
echo "Supernode läuft (Backup Netz Aktiv)"
|
|
elif [ $supernode_status == 3 ]; then
|
|
echo "Supernode läuft (Backup deaktiviert)"
|
|
fi
|
|
echo -e "\nSupernode Status: (Soll-Zustand)"
|
|
if [ $supernode_mode == 0 ]; then
|
|
echo "Supernode ist Abgeschaltet"
|
|
elif [ $supernode_mode == 1 ]; then
|
|
echo "Supernode läuft (Automatik inkl. Backup)"
|
|
elif [ $supernode_mode == 2 ]; then
|
|
echo "Supernode läuft (Backup Netz Aktiv)"
|
|
elif [ $supernode_mode == 3 ]; then
|
|
echo "Supernode läuft (Backup deaktiviert)"
|
|
fi
|
|
echo -e "\nService Status"
|
|
for service in bird bird6 dhcpd radvd python named
|
|
do
|
|
if [ "$(/bin/cat /etc/supernode-status/$service.status)" = "1" ]; then
|
|
echo -e "$service läuft"
|
|
else
|
|
echo -e "$service aus"
|
|
fi
|
|
done
|
|
}
|
|
|
|
off () {
|
|
echo 0 > /etc/supernode-status/supernode.mode
|
|
echo "Supernode Aus"
|
|
}
|
|
|
|
on () {
|
|
echo 1 > /etc/supernode-status/supernode.mode
|
|
echo "Supernode An"
|
|
}
|
|
|
|
backup () {
|
|
echo 2 > /etc/supernode-status/supernode.mode
|
|
echo "Supernode Aktiviert inkl. Backup"
|
|
}
|
|
|
|
backup_off () {
|
|
echo 3 > /etc/supernode-status/supernode.mode
|
|
echo "Supernode Aktiviert (Backup deaktiviert)"
|
|
}
|
|
$1 |