functions to remove batman

This commit is contained in:
Bob Mottram 2016-07-03 19:54:48 +01:00
parent 879ab883fb
commit 64a64641d1
2 changed files with 24 additions and 1 deletions

View File

@ -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

View File

@ -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