-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake
executable file
·33 lines (31 loc) · 905 Bytes
/
make
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env sh
# SPDX-License-Identifier: Unlicense
# shellcheck disable=SC2046,SC2086
. ./dot-slash-make.sh
param PREFIX=/etc/systemd/system
unit_files="[email protected] ${timer_unit}"
selinux_flag=-Z
case $(install -Z 2>&1) in *'unrecognized option'*) selinux_flag='' ;; esac
script_files=$(wildcard ./*.sh ./make)
for __target in ${__dsm__targets}; do
case "${__target}" in
install)
run install -D ${selinux_flag} -m 644 -t "$PREFIX" $unit_files
run systemctl daemon-reload
;;
uninstall)
run_ systemctl disable --now "$timer_unit"
run_ rm -f $(printf "${PREFIX}/%s " $unit_files)
;;
lint)
run shellcheck ${script_files}
run shfmt -p -d ${script_files}
;;
format)
run shfmt -p -w ${script_files}
;;
# dot-slash-make: This * case must be last and should not be changed
*) abort "No rule to make target '${__target}'" ;;
esac
done