debian/booth-generator
raw| 1 | #!/bin/sh |
| 2 | |
| 3 | set -eu |
| 4 | |
| 5 | GENDIR="$1" |
| 6 | WANTDIR="$1/booth.service.wants" |
| 7 | SERVICEFILE="/lib/systemd/system/[email protected]" |
| 8 | AUTOSTART="all" |
| 9 | CONFIG_DIR=/etc/booth |
| 10 | DEFAULT_CONF=/etc/default/booth |
| 11 | |
| 12 | mkdir -p "$WANTDIR" |
| 13 | |
| 14 | # generate systemd service files for all *.conf files within $CONFIG_DIR |
| 15 | for CONFIG in `cd $CONFIG_DIR; ls *.conf 2> /dev/null`; do |
| 16 | NAME=${CONFIG%%.conf} |
| 17 | ln -s "$SERVICEFILE" "$WANTDIR/booth@$NAME.service" |
| 18 | done |
| 19 | |
| 20 | exit 0 |
| 21 |