-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontainerinit.ash
More file actions
47 lines (42 loc) · 814 Bytes
/
containerinit.ash
File metadata and controls
47 lines (42 loc) · 814 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
#!/bin/ash
contSetup () {
apk add sudo
echo "containeradmin ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
}
contStart () {
[ -f /etc/sudoers ] || contSetup
# Start the services
/usr/bin/supervisord
}
contHelp () {
echo "Available options:"
echo " cont:start - Starts all services needed"
echo " cont:setup - First time setup."
echo " cont:help - Displays the help"
echo " [command] - Execute the specified linux command eg. /bin/ash."
}
case "$1" in
cont:start)
contStart
;;
cont:setup)
contSetup
;;
cont:help)
contHelp
;;
*)
if [ -x $1 ]; then
$1
else
prog=$(which $1)
if [ -n "${prog}" ] ; then
shift 1
$prog $@
else
contHelp
fi
fi
;;
esac
exit 0