-
Notifications
You must be signed in to change notification settings - Fork 321
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allows openfortivpn to act as system service. The configuration is expected under $(sysconfdir)/openfortivpn/<NAME>.conf. https://www.freedesktop.org/software/systemd/man/daemon.html#Installing%20systemd%20Service%20Files
- Loading branch information
1 parent
8b0c235
commit 41cd81f
Showing
3 changed files
with
43 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,25 +26,35 @@ data_DATA=etc/openfortivpn/config.template | |
|
||
etc/openfortivpn/config: $(srcdir)/etc/openfortivpn/config.template | ||
@$(MKDIR_P) etc/openfortivpn | ||
$(AM_V_GEN)$(SED) -e '3,$$ s/^/# /' $(srcdir)/etc/openfortivpn/config.template >$@ | ||
$(AM_V_GEN)$(SED) -e '3,$$ s|^|# |' $(srcdir)/etc/openfortivpn/config.template >$@ | ||
|
||
install-data-hook: etc/openfortivpn/config | ||
lib/systemd/system/[email protected]: $(srcdir)/lib/systemd/system/[email protected] | ||
@$(MKDIR_P) lib/systemd/system | ||
$(AM_V_GEN)$(SED) -e 's|[@]SYSCONFDIR[@]|$(sysconfdir)|g' $(srcdir)/lib/systemd/system/[email protected] >$@ | ||
|
||
install-data-hook: etc/openfortivpn/config lib/systemd/system/[email protected] | ||
if ! test -f $(DESTDIR)$(confdir)/config ; then \ | ||
$(MKDIR_P) $(DESTDIR)$(confdir) ; \ | ||
$(INSTALL) -m 600 etc/openfortivpn/config \ | ||
$(DESTDIR)$(confdir)/config ; \ | ||
fi | ||
if HAVE_SYSTEMD | ||
$(MKDIR_P) $(systemdsystemunitdir) | ||
$(INSTALL) lib/systemd/system/[email protected] \ | ||
$(systemdsystemunitdir) | ||
endif | ||
|
||
dist_man_MANS = doc/openfortivpn.1 | ||
|
||
doc/openfortivpn.1: $(srcdir)/doc/openfortivpn.1.in | ||
@$(MKDIR_P) doc | ||
$(AM_V_GEN)$(SED) -e 's|[@]SYSCONFDIR[@]|$(sysconfdir)|g;s|[@]DATADIR[@]|$(datadir)|g' $(srcdir)/doc/openfortivpn.1.in >$@ | ||
|
||
all-local: etc/openfortivpn/config | ||
all-local: etc/openfortivpn/config lib/systemd/system/[email protected] | ||
|
||
clean-local: | ||
-rm -f etc/openfortivpn/config | ||
-rm -f lib/systemd/system/[email protected] | ||
-rm -f doc/openfortivpn.1 | ||
|
||
EXTRA_DIST = autogen.sh CHANGELOG.md LICENSE LICENSE.OpenSSL README.md doc/openfortivpn.1.in $(data_DATA) | ||
EXTRA_DIST = autogen.sh CHANGELOG.md LICENSE LICENSE.OpenSSL README.md doc/openfortivpn.1.in $(data_DATA) lib/systemd/system/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[Unit] | ||
Description=OpenFortiVPN for %I | ||
After=network-online.target | ||
|
||
[Service] | ||
Type=simple | ||
PrivateTmp=true | ||
ExecStart=/usr/bin/openfortivpn -c @SYSCONFDIR@/openfortivpn/%I.conf | ||
OOMScoreAdjust=-100 | ||
|
||
[Install] | ||
WantedBy=multi-user.target |