-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathsupervisor_run
More file actions
executable file
·47 lines (39 loc) · 1.31 KB
/
supervisor_run
File metadata and controls
executable file
·47 lines (39 loc) · 1.31 KB
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/bash
set -e
source /etc/supervisor_scripts/common
echo "Run Supervisor"
function run_supervisor() {
validate_devcontainer "apps"
local apparmor_profile="hassio-supervisor"
if [ -n "${SUPERVISOR_UNCONFINED}" ]; then
apparmor_profile="unconfined"
fi
docker run --rm --privileged \
--name hassio_supervisor \
--privileged \
--security-opt seccomp=unconfined \
--security-opt "apparmor=${apparmor_profile}" \
-v /run/docker.sock:/run/docker.sock:rw \
-v /run/dbus:/run/dbus:ro \
-v /run/supervisor:/run/os:rw \
-v /run/udev:/run/udev:ro \
-v /mnt/supervisor:/data:rw \
-v /etc/machine-id:/etc/machine-id:ro \
-e SUPERVISOR_SHARE="/mnt/supervisor" \
-e SUPERVISOR_NAME=hassio_supervisor \
-e SUPERVISOR_MACHINE="qemu${QEMU_ARCH}" \
-e SUPERVISOR_SYSTEMD_JOURNAL_GATEWAYD_URL="http://172.30.32.1:19531/" \
"${SUPERVISOR_IMAGE}:${SUPERVISOR_VERSION}"
}
if [ "$( docker container inspect -f '{{.State.Status}}' hassio_supervisor )" == "running" ]; then
echo "Restarting Supervisor"
docker rm -f hassio_supervisor
cleanup_lastboot
run_supervisor
else
echo "Starting Supervisor"
docker system prune -f
cleanup_lastboot
cleanup_docker
run_supervisor
fi