-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsup
27 lines (20 loc) · 796 Bytes
/
sup
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
#!/bin/sh
set -e
# Load configs
CONFIG_FILE=%%HASSIO_CONFIG%%
SUPERVISOR="$(jq --raw-output '.supervisor' ${CONFIG_FILE})"
HOMEASSISTANT="$(jq --raw-output '.homeassistant' ${CONFIG_FILE})"
DATA="$(jq --raw-output '.data // "/usr/share/hassio"' ${CONFIG_FILE})"
echo "-------------"
echo $HOMEASSISTANT
echo "-------------"
# AppArmor Support
if command -v apparmor_parser > /dev/null 2>&1 && grep hassio-supervisor /sys/kernel/security/apparmor/profiles > /dev/null 2>&1; then
APPARMOR="--security-opt apparmor=hassio-supervisor"
else
APPARMOR="--security-opt apparmor:unconfined"
fi
# Init supervisor
HASSIO_DATA=${DATA}
HASSIO_IMAGE_ID=$(docker inspect --format='{{.Id}}' "${SUPERVISOR}")
HASSIO_CONTAINER_ID=$(docker inspect --format='{{.Image}}' hassio_supervisor || echo "")