This commit is contained in:
monsieuremre 2023-10-27 17:36:55 +00:00 committed by GitHub
parent 46fef2a5ee
commit 9f89cf35e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,26 +1,34 @@
BUILD=.build
DESTDIR=/
for profile in "$@"
do
cp $BUILD/apparmor.d/$profile $DESTDIR/etc/apparmor.d/$profile
grep "rPx," "$BUILD/apparmor.d/$profile" | while read l1
echo "Installing profile $profile"
cp $BUILD/apparmor.d/$profile $DESTDIR/etc/apparmor.d/
grep "rPx," "${BUILD}/apparmor.d/${profile}" | while read line
do
dep=$(echo "$l1" | awk '{print $1}')
dep=$(echo $dep | awk -F"/" '{print $NF}')
find . -type f -name $dep | while read l2
dep=$(eval "ls ${BUILD}/apparmor.d/${dep} 2>/dev/null")
for i in $dep
do
if [ ! -f "$DESTDIR/etc/apparmor.d/$dep" ]; then
install_seperate_with_depends $dep
i=$(echo $i | awk -F"/" '{print $NF}')
if [ ! -f "$DESTDIR/etc/apparmor.d/$i" ]; then
bash "$0" "$i"
fi
done
done
grep "rPx -> " $BUILD/apparmor.d/$profile | while read l1
grep "rPx -> " "${BUILD}/apparmor.d/${profile}" | while read line
do
dep=$(echo $l1 | awk '{print $NF}' | awk '{if (NR!=1) {print substr($2, 1, length($2)-1)}}')
find . -type f -name $dep | while read l2
dep=${line%%#*}
dep=$(echo $dep | awk '{print $NF}')
dep=${dep::-1}
dep=$(eval "ls ${BUILD}/apparmor.d/${dep} 2>/dev/null")
for i in $dep
do
if [ ! -f "$DESTDIR/etc/apparmor.d/$dep" ]; then
install_seperate_with_depends $dep
i=$(echo $i | awk -F"/" '{print $NF}')
if [ ! -f "$DESTDIR/etc/apparmor.d/$i" ]; then
bash "$0" "$i"
fi
done
done