51 lines
1.3 KiB
Bash
51 lines
1.3 KiB
Bash
#!/bin/bash
|
|
help () {
|
|
echo "Supernode Settings:"
|
|
echo "status | off | on | auto"
|
|
}
|
|
|
|
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
|
|
echo "Supernode läuft (Loadbalancing)"
|
|
elif [ $supernode_status == 2 ]; then
|
|
echo "Supernode läuft (Dauer-Ein)"
|
|
elif [ $supernode_status == 3 ]; then
|
|
echo "Supernode Offline (Loadbalancing)"
|
|
fi
|
|
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
|
|
}
|
|
|
|
off () {
|
|
echo 0 > /etc/supernode-status/supernode.mode
|
|
echo 0 > /etc/supernode-status/loadbalancing.mode
|
|
|
|
echo "Supernode Aus"
|
|
}
|
|
|
|
on () {
|
|
echo 1 > /etc/supernode-status/supernode.mode
|
|
echo 0 > /etc/supernode-status/loadbalancing.mode
|
|
echo "Supernode Dauer-An"
|
|
}
|
|
|
|
auto () {
|
|
echo 1 > /etc/supernode-status/loadbalancing.mode
|
|
echo 1 > /etc/supernode-status/supernode.mode
|
|
echo "Supernode Aktiviert inkl. Loadbalance"
|
|
}
|
|
$1
|