functions to remove batman
This commit is contained in:
parent
879ab883fb
commit
64a64641d1
|
@ -45,6 +45,20 @@ function configure_firewall_for_batman {
|
|||
echo 'configure_firewall_for_batman' >> $COMPLETION_FILE
|
||||
}
|
||||
|
||||
function remove_batman {
|
||||
if ! grep -Fxq "mesh_batman" $COMPLETION_FILE; then
|
||||
return
|
||||
fi
|
||||
|
||||
${PROJECT_NAME}-mesh-install -f batman --remove yes
|
||||
if [ ! "$?" = "0" ]; then
|
||||
echo $'Failed to remove batman'
|
||||
exit 79353
|
||||
fi
|
||||
sed -i '/mesh_batman/d' $COMPLETION_FILE
|
||||
sed -i '/configure_firewall_for_batman/d' $COMPLETION_FILE
|
||||
}
|
||||
|
||||
function mesh_batman {
|
||||
if grep -Fxq "mesh_batman" $COMPLETION_FILE; then
|
||||
return
|
||||
|
|
|
@ -333,6 +333,11 @@ function mesh_babel_client {
|
|||
sudo mv $babel_script ${rootdir}/usr/bin/babel
|
||||
}
|
||||
|
||||
function mesh_batman_remove {
|
||||
systemctl stop batman
|
||||
rm $rootdir/var/lib/batman
|
||||
rm $rootdir/etc/systemd/system/batman.service
|
||||
}
|
||||
|
||||
function mesh_batman {
|
||||
$CHROOT_PREFIX apt-get -y install iproute bridge-utils libnetfilter-conntrack3 batctl
|
||||
|
@ -1068,7 +1073,11 @@ if [[ $FN == 'firewall' ]]; then
|
|||
mesh_firewall
|
||||
fi
|
||||
if [[ $FN == 'batman' ]]; then
|
||||
mesh_batman
|
||||
if [[ $REMOVE != 'yes' ]]; then
|
||||
mesh_batman
|
||||
else
|
||||
mesh_batman_remove
|
||||
fi
|
||||
fi
|
||||
if [[ $FN == 'batman_client' ]]; then
|
||||
mesh_batman_client
|
||||
|
|
Loading…
Reference in New Issue