ansible.fftdf.supernode/files/supernode

61 lines
1.6 KiB
Plaintext
Raw Normal View History

2016-04-17 21:12:28 +00:00
#!/bin/bash
help () {
echo "Supernode Settings:"
2016-06-04 00:01:34 +00:00
echo "status | off | on | backup | backup_off"
2016-04-17 21:12:28 +00:00
}
status () {
supernode_status=$(/bin/cat /etc/supernode-status/supernode.status)
supernode_mode=$(/bin/cat /etc/supernode-status/supernode.mode)
2016-06-04 00:01:34 +00:00
echo -e "\nSupernode Status: (Ist-Zustand)"
2016-04-17 21:12:28 +00:00
if [ $supernode_status == 0 ]; then
2016-06-04 00:01:34 +00:00
echo "Supernode ist Abgeschaltet"
2016-04-17 21:12:28 +00:00
elif [ $supernode_status == 1 ]; then
2016-06-04 00:01:34 +00:00
echo "Supernode läuft (Automatik inkl. Backup)"
2016-04-17 21:12:28 +00:00
elif [ $supernode_status == 2 ]; then
2016-06-04 00:01:34 +00:00
echo "Supernode läuft (Backup Netz Aktiv)"
elif [ $supernode_status == 3 ]; then
echo "Supernode läuft (Backup deaktiviert)"
2016-04-17 21:12:28 +00:00
fi
2016-06-04 00:01:34 +00:00
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"
2016-05-06 19:38:11 +00:00
for service in bird bird6 dhcpd radvd python named
do
if [ "$(/bin/cat /etc/supernode-status/$service.status)" = "1" ]; then
2016-06-04 00:01:34 +00:00
echo -e "$service läuft"
2016-05-06 19:38:11 +00:00
else
2016-06-04 00:01:34 +00:00
echo -e "$service aus"
2016-05-06 19:38:11 +00:00
fi
done
2016-04-17 21:12:28 +00:00
}
off () {
echo 0 > /etc/supernode-status/supernode.mode
2016-05-06 10:11:44 +00:00
echo "Supernode Aus"
2016-04-17 21:12:28 +00:00
}
on () {
echo 1 > /etc/supernode-status/supernode.mode
2016-05-28 12:56:57 +00:00
echo "Supernode An"
2016-05-06 08:56:16 +00:00
}
2016-05-28 12:56:57 +00:00
backup () {
echo 2 > /etc/supernode-status/supernode.mode
echo "Supernode Aktiviert inkl. Backup"
2016-04-17 21:12:28 +00:00
}
2016-06-04 00:01:34 +00:00
backup_off () {
echo 3 > /etc/supernode-status/supernode.mode
echo "Supernode Aktiviert (Backup deaktiviert)"
}
$1