mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
feat(apparmor): Add AppArmor profile install scripts
Add scripts for installing AppArmor profiles.
This commit is contained in:
parent
137cce19bc
commit
2e682c6e6a
29
security/apparmor/2.12.1/install.sh
Executable file
29
security/apparmor/2.12.1/install.sh
Executable file
|
@ -0,0 +1,29 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e -u pipefail
|
||||
|
||||
readonly SCRIPT_DIR=$(dirname $(readlink -f $0))
|
||||
|
||||
if [[ $(id -u) != 0 ]]
|
||||
then
|
||||
>&2 echo "Please run as root."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -z $(which apparmor_parser) ]]
|
||||
then
|
||||
>&2 echo "AppArmor not found."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Copying AppArmor files..."
|
||||
[[ ! -d "/etc/apparmor.d/tunables/usr.bin.qtox.d/" ]] && mkdir -v "/etc/apparmor.d/tunables/usr.bin.qtox.d/"
|
||||
cp -v "${SCRIPT_DIR}/tunables/usr.bin.qtox" "/etc/apparmor.d/tunables/"
|
||||
cp -v "${SCRIPT_DIR}/usr.bin.qtox" "/etc/apparmor.d/"
|
||||
touch "/etc/apparmor.d/local/usr.bin.qtox"
|
||||
|
||||
echo "Restarting AppArmor..."
|
||||
systemctl restart apparmor
|
||||
|
||||
echo "Done."
|
||||
|
31
security/apparmor/2.13.2/install.sh
Executable file
31
security/apparmor/2.13.2/install.sh
Executable file
|
@ -0,0 +1,31 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e -u pipefail
|
||||
|
||||
readonly SCRIPT_DIR=$(dirname $(readlink -f $0))
|
||||
|
||||
if [[ $(id -u) != 0 ]]
|
||||
then
|
||||
>&2 echo "Please run as root."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -z $(which apparmor_parser) ]]
|
||||
then
|
||||
>&2 echo "AppArmor not found."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#NOTE: we do not need to create /etc/apparmor.d/tunables/usr.bin.qtox.d/ or
|
||||
#/etc/apparmor.d/local/usr.bin.qtox because AppArmor >2.13 support #include if
|
||||
#exists
|
||||
|
||||
echo "Copying AppArmor files..."
|
||||
cp -v "${SCRIPT_DIR}/tunables/usr.bin.qtox" "/etc/apparmor.d/tunables/"
|
||||
cp -v "${SCRIPT_DIR}/usr.bin.qtox" "/etc/apparmor.d/"
|
||||
|
||||
echo "Restarting AppArmor..."
|
||||
systemctl restart apparmor
|
||||
|
||||
echo "Done."
|
||||
|
Loading…
Reference in New Issue
Block a user