forked from goose-ws/docker-cups
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-entrypoint.sh
More file actions
executable file
·51 lines (46 loc) · 894 Bytes
/
docker-entrypoint.sh
File metadata and controls
executable file
·51 lines (46 loc) · 894 Bytes
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env bash
function stop_cmd {
echo "Caught ${1}"
/usr/local/bin/user-management --save-persistent-users
exit 0
}
function stop_cmd_1 {
stop_cmd "SIGTERM"
}
function stop_cmd_2 {
stop_cmd "SIGQUIT"
}
function stop_cmd_3 {
stop_cmd "SIGINT"
}
function stop_cmd_4 {
stop_cmd "SIGHUP"
}
function stop_cmd_5 {
stop_cmd "ERR"
}
function stop_cmd_6 {
stop_cmd "SIGKILL"
}
trap stop_cmd_1 SIGTERM
trap stop_cmd_2 SIGQUIT
trap stop_cmd_3 SIGINT
trap stop_cmd_4 SIGHUP
trap stop_cmd_5 ERR
trap stop_cmd_6 SIGKILL
if [[ -z "${@}" ]]; then
echo "Loading persistent users"
/usr/sbin/avahi-daemon -D
sleep 3
echo "Loading persistent users"
/usr/local/bin/user-management --load-persistent-users
if ! [[ -f /etc/cups/cupsd.conf ]]; then
cp -rpn /etc/cups-skel/* /etc/cups/
fi
echo "Testing cupsd config"
/usr/sbin/cupsd -t
echo "Starting cupsd"
/usr/sbin/cupsd -f
else
"${@}"
fi