mirror of
https://github.com/home-assistant/operating-system.git
synced 2025-07-28 15:36:29 +00:00
Simplify AppArmor with new OS-Agent SU (#1622)
This commit is contained in:
parent
8058392043
commit
8c1ff000f0
@ -4,7 +4,6 @@ set -e
|
|||||||
APPARMOR_URL="https://version.home-assistant.io/apparmor.txt"
|
APPARMOR_URL="https://version.home-assistant.io/apparmor.txt"
|
||||||
PROFILES_DIR="/mnt/data/supervisor/apparmor"
|
PROFILES_DIR="/mnt/data/supervisor/apparmor"
|
||||||
CACHE_DIR="${PROFILES_DIR}/cache"
|
CACHE_DIR="${PROFILES_DIR}/cache"
|
||||||
REMOVE_DIR="${PROFILES_DIR}/remove"
|
|
||||||
|
|
||||||
# Check folder structure
|
# Check folder structure
|
||||||
if [ ! -d "${PROFILES_DIR}" ]; then
|
if [ ! -d "${PROFILES_DIR}" ]; then
|
||||||
@ -14,9 +13,8 @@ if [ ! -d "${PROFILES_DIR}" ]; then
|
|||||||
curl -sL -o "${PROFILES_DIR}"/hassio-supervisor "${APPARMOR_URL}"
|
curl -sL -o "${PROFILES_DIR}"/hassio-supervisor "${APPARMOR_URL}"
|
||||||
fi
|
fi
|
||||||
mkdir -p "${CACHE_DIR}"
|
mkdir -p "${CACHE_DIR}"
|
||||||
mkdir -p "${REMOVE_DIR}"
|
|
||||||
|
|
||||||
# Load/Update exists/new profiles
|
# Load exists profiles
|
||||||
for profile in "${PROFILES_DIR}"/*; do
|
for profile in "${PROFILES_DIR}"/*; do
|
||||||
if [ ! -f "${profile}" ]; then
|
if [ ! -f "${profile}" ]; then
|
||||||
continue
|
continue
|
||||||
@ -27,18 +25,3 @@ for profile in "${PROFILES_DIR}"/*; do
|
|||||||
echo "[Error]: Can't load profile ${profile}"
|
echo "[Error]: Can't load profile ${profile}"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# Cleanup old profiles
|
|
||||||
for profile in "${REMOVE_DIR}"/*; do
|
|
||||||
if [ ! -f "${profile}" ]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Unload Profile
|
|
||||||
if apparmor_parser -R -W -L "${CACHE_DIR}" "${profile}"; then
|
|
||||||
if rm "${profile}"; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
echo "[Error]: Can't remove profile ${profile}"
|
|
||||||
done
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user