ansible.fftdf.supernode/files/supernode

45 lines
1.0 KiB
Plaintext
Raw Normal View History

2016-04-17 21:12:28 +00:00
#!/bin/bash
help () {
echo "Supernode Settings:"
2016-05-06 10:11:44 +00:00
echo "status | off | on | auto"
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)
loadbalancing=$(cat /etc/supernode-status/loadbalancing.mode)
echo "Supernode Status: (Ist-Zustand)"
if [ $supernode_status == 0 ]; then
echo "Supernode ist Offline"
elif [ $supernode_status == 1 ]; then
2016-05-28 12:56:57 +00:00
echo "Supernode läuft"
2016-04-17 21:12:28 +00:00
elif [ $supernode_status == 2 ]; then
2016-05-28 12:56:57 +00:00
echo "Supernode läuft (Backup)"
2016-04-17 21:12:28 +00:00
fi
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
echo -e "$service \e[1;4;93mläuft\e[0m"
else
echo -e "$service \e[1;4;91mläuft nicht\e[0m"
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
}
$1