Added systemd generators for tellus
This commit is contained in:
parent
fea8c89343
commit
2cb0dd36d3
4 changed files with 57 additions and 3 deletions
22
systemd/tellusagent-generator
Normal file
22
systemd/tellusagent-generator
Normal file
|
@ -0,0 +1,22 @@
|
|||
#!/bin/sh
|
||||
|
||||
# This systemd generator creates dependency symlinks that make all OpenVPN
|
||||
# tunnels listed in /etc/default/openvpn's AUTOSTART be started/stopped/reloaded
|
||||
# when openvpn.service is started/stopped/reloaded.
|
||||
|
||||
set -eu
|
||||
|
||||
GENDIR="$1"
|
||||
WANTDIR="$1/tellusagent.service.wants"
|
||||
SERVICEFILE="/lib/systemd/system/tellusagent@.service"
|
||||
CONFIG_DIR=/opt/TellusAgent/
|
||||
|
||||
mkdir -p "$WANTDIR"
|
||||
|
||||
for CONFIG in `cd $CONFIG_DIR; ls *.conf 2> /dev/null`; do
|
||||
NAME=${CONFIG%%.conf}
|
||||
ln -s "$SERVICEFILE" "$WANTDIR/tellusagent@$NAME.service"
|
||||
done
|
||||
|
||||
exit 0
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue