From 446d3fca7cf2ae671ffa67db2edb9b23f7cb906e Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 28 Jun 2015 21:57:58 +0100 Subject: [PATCH] daemon for mesh tunnel --- src/freedombone | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/freedombone b/src/freedombone index 688313b6..3e3dd3d0 100755 --- a/src/freedombone +++ b/src/freedombone @@ -1613,7 +1613,26 @@ function mesh_batman { echo 'fi' >> /opt/tunneldigger/broker/scripts/up_hook.sh chmod 755 up_hook.sh - # TODO make a systemd service to run ./l2tp_broker.py l2tp_broker.cfg + # make a systemd service to run ./l2tp_broker.py l2tp_broker.cfg + echo '[Unit]' > /etc/systemd/system/tunneldigger.service + echo 'Description=tunnerdigger (l2tp tunnel)' >> /etc/systemd/system/tunneldigger.service + echo 'After=syslog.target' >> /etc/systemd/system/tunneldigger.service + echo 'After=network.target' >> /etc/systemd/system/tunneldigger.service + echo '' >> /etc/systemd/system/tunneldigger.service + echo '[Service]' >> /etc/systemd/system/tunneldigger.service + echo 'Type=simple' >> /etc/systemd/system/tunneldigger.service + echo 'User=root' >> /etc/systemd/system/tunneldigger.service + echo 'Group=root' >> /etc/systemd/system/tunneldigger.service + echo 'WorkingDirectory=/opt/tunneldigger/broker' >> /etc/systemd/system/tunneldigger.service + echo 'ExecStart=/opt/tunneldigger/broker/l2tp_broker.py l2tp_broker.cfg' >> /etc/systemd/system/tunneldigger.service + echo 'Restart=always' >> /etc/systemd/system/tunneldigger.service + echo 'Environment="USER=root" "HOME=/opt/tunneldigger/broker"' >> /etc/systemd/system/tunneldigger.service + echo '' >> /etc/systemd/system/tunneldigger.service + echo '[Install]' >> /etc/systemd/system/tunneldigger.service + echo 'WantedBy=multi-user.target' >> /etc/systemd/system/tunneldigger.service + systemctl enable tunneldigger + systemctl daemon-reload + systemctl restart tunneldigger if ! grep -q "Mesh Networking (B.A.T.M.A.N)" /home/$MY_USERNAME/README; then echo '' >> /home/$MY_USERNAME/README