daemon for mesh tunnel

This commit is contained in:
Bob Mottram 2015-06-28 21:57:58 +01:00
parent 0158af73a7
commit 446d3fca7c
1 changed files with 20 additions and 1 deletions

View File

@ -1613,7 +1613,26 @@ function mesh_batman {
echo 'fi' >> /opt/tunneldigger/broker/scripts/up_hook.sh echo 'fi' >> /opt/tunneldigger/broker/scripts/up_hook.sh
chmod 755 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 if ! grep -q "Mesh Networking (B.A.T.M.A.N)" /home/$MY_USERNAME/README; then
echo '' >> /home/$MY_USERNAME/README echo '' >> /home/$MY_USERNAME/README