File: booth-generator

package info (click to toggle)
booth 1.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 852 kB
  • sloc: ansic: 7,181; sh: 2,166; python: 471; makefile: 280; xml: 7
file content (21 lines) | stat: -rwxr-xr-x 428 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh

set -eu

GENDIR="$1"
WANTDIR="$1/booth.service.wants"
SERVICEFILE="/lib/systemd/system/booth@.service"
AUTOSTART="all"
CONFIG_DIR=/etc/booth
DEFAULT_CONF=/etc/default/booth

mkdir -p "$WANTDIR"

# generate systemd service files for all *.conf files within $CONFIG_DIR
for CONFIG in `cd $CONFIG_DIR; ls *.conf 2> /dev/null`; do
	NAME=${CONFIG%%.conf}
	ln -s "$SERVICEFILE" "$WANTDIR/booth@$NAME.service"
done

exit 0