Stopping mesh protocol before starting another
This commit is contained in:
parent
73dd40180a
commit
4b19fc06ea
|
@ -97,6 +97,10 @@ function stop {
|
||||||
disable_mesh_firewall
|
disable_mesh_firewall
|
||||||
|
|
||||||
systemctl restart network-manager
|
systemctl restart network-manager
|
||||||
|
|
||||||
|
if [ -f $MESH_CURRENT_PROTOCOL ]; then
|
||||||
|
rm $MESH_CURRENT_PROTOCOL
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function verify {
|
function verify {
|
||||||
|
@ -152,6 +156,8 @@ function start {
|
||||||
fi
|
fi
|
||||||
echo "info: enabling batman-adv mesh network $WIFI_SSID on $IFACE"
|
echo "info: enabling batman-adv mesh network $WIFI_SSID on $IFACE"
|
||||||
|
|
||||||
|
mesh_protocol_stop
|
||||||
|
|
||||||
systemctl stop network-manager
|
systemctl stop network-manager
|
||||||
sleep 5
|
sleep 5
|
||||||
|
|
||||||
|
@ -225,6 +231,8 @@ function start {
|
||||||
systemctl restart nginx
|
systemctl restart nginx
|
||||||
|
|
||||||
verify
|
verify
|
||||||
|
|
||||||
|
echo "batman-adv" > $MESH_CURRENT_PROTOCOL
|
||||||
}
|
}
|
||||||
|
|
||||||
function monitor {
|
function monitor {
|
||||||
|
|
|
@ -87,6 +87,10 @@ function stop {
|
||||||
disable_mesh_firewall
|
disable_mesh_firewall
|
||||||
|
|
||||||
systemctl restart network-manager
|
systemctl restart network-manager
|
||||||
|
|
||||||
|
if [ -f $MESH_CURRENT_PROTOCOL ]; then
|
||||||
|
rm $MESH_CURRENT_PROTOCOL
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function verify {
|
function verify {
|
||||||
|
@ -133,7 +137,8 @@ function start {
|
||||||
fi
|
fi
|
||||||
echo "info: enabling BMX6 mesh network $WIFI_SSID on $IFACE"
|
echo "info: enabling BMX6 mesh network $WIFI_SSID on $IFACE"
|
||||||
|
|
||||||
batman stop
|
mesh_protocol_stop
|
||||||
|
|
||||||
systemctl stop network-manager
|
systemctl stop network-manager
|
||||||
sleep 5
|
sleep 5
|
||||||
|
|
||||||
|
@ -207,6 +212,8 @@ function start {
|
||||||
systemctl restart nginx
|
systemctl restart nginx
|
||||||
|
|
||||||
verify
|
verify
|
||||||
|
|
||||||
|
echo "bmx6" > $MESH_CURRENT_PROTOCOL
|
||||||
}
|
}
|
||||||
|
|
||||||
function monitor {
|
function monitor {
|
||||||
|
|
|
@ -28,6 +28,25 @@
|
||||||
# You should have received a copy of the GNU Affero General Public License
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
# File which contains the current protocol in use
|
||||||
|
MESH_CURRENT_PROTOCOL=~/.mesh_protocol
|
||||||
|
|
||||||
|
function mesh_protocol_stop {
|
||||||
|
if [ ! -f $MESH_CURRENT_PROTOCOL ]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
if grep -q "bmx6" $MESH_CURRENT_PROTOCOL; then
|
||||||
|
bmx stop
|
||||||
|
fi
|
||||||
|
|
||||||
|
if grep -q "batman-adv" $MESH_CURRENT_PROTOCOL; then
|
||||||
|
batman stop
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm $MESH_CURRENT_PROTOCOL
|
||||||
|
}
|
||||||
|
|
||||||
function mesh_protocol_init {
|
function mesh_protocol_init {
|
||||||
if [[ $1 == "start" ]]; then
|
if [[ $1 == "start" ]]; then
|
||||||
# install avahi
|
# install avahi
|
||||||
|
|
Loading…
Reference in New Issue