From 741ef6f7c984839dd9124021f15528876402587f Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 2 Oct 2017 22:52:44 +0100 Subject: [PATCH] Script for shutting down the mesh --- src/freedombone-image-customise | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/freedombone-image-customise b/src/freedombone-image-customise index f665de63..52de53b4 100755 --- a/src/freedombone-image-customise +++ b/src/freedombone-image-customise @@ -639,6 +639,21 @@ EOF cp $rootdir/root/$PROJECT_NAME/img/icon_ferment.png $rootdir/etc/patchwork/icon_ferment.png } +mesh_shutdown_script() { + echo '[Unit]' > $rootdir/etc/systemd/system/meshshutdown.service + echo 'Description=Shuts down the mesh' >> $rootdir/etc/systemd/system/meshshutdown.service + echo 'Before=shutdown.target' >> $rootdir/etc/systemd/system/meshshutdown.service + echo '' >> $rootdir/etc/systemd/system/meshshutdown.service + echo '[Service]' >> $rootdir/etc/systemd/system/meshshutdown.service + echo 'ExecStart=/bin/true' >> $rootdir/etc/systemd/system/meshshutdown.service + echo 'ExecStop=/bin/bash /usr/local/bin/batman stop' >> $rootdir/etc/systemd/system/meshshutdown.service + echo 'RemainAfterExit=yes' >> $rootdir/etc/systemd/system/meshshutdown.service + echo '' >> $rootdir/etc/systemd/system/meshshutdown.service + echo '[Install]' >> $rootdir/etc/systemd/system/meshshutdown.service + echo 'WantedBy=multi-user.target' >> $rootdir/etc/systemd/system/meshshutdown.service + chroot "$rootdir" systemctl enable meshshutdown +} + initialise_mesh() { if [[ $VARIANT != "mesh"* ]]; then return @@ -672,6 +687,7 @@ initialise_mesh() { configure_firewall install_avahi install_batman + mesh_shutdown_script install_vpn install_tomb #install_tahoelafs