# HG changeset patch # User Malcolm Scott # Date 1411487171 -3600 # Tue Sep 23 16:46:11 2014 +0100 # Node ID 5da07a33c6981b126acb7b5eb02ef2dd6d284fbb # Parent 48f5c6b07021d646fe3668f102a8e2a6e4fdf5d5 Add systemd service diff --git a/debian/control b/debian/control --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Section: net Priority: optional Standards-Version: 3.9.5 -Build-Depends: debhelper (>= 9) +Build-Depends: debhelper (>= 9), dh-systemd (>= 1.5) Package: nfw-redirector Architecture: all diff --git a/debian/rules b/debian/rules --- a/debian/rules +++ b/debian/rules @@ -1,4 +1,4 @@ #!/usr/bin/make -f %: - dh $@ + dh $@ --with-systemd diff --git a/debian/service b/debian/service new file mode 100644 --- /dev/null +++ b/debian/service @@ -0,0 +1,14 @@ +[Unit] +Description=nfw captive portal redirector +After=network.target + +[Service] +Environment=BIND_ADDRESS=localhost BIND_PORT=8080 URL=https://nfw.example.org/enrol +EnvironmentFile=-/etc/default/nfw-redirector +ExecStart=/usr/bin/nfw-redirector --bind-address ${BIND_ADDRESS} --bind-port ${BIND_PORT} ${URL} +Restart=on-failure +User=nobody + +[Install] +WantedBy=multi-user.target +