modify permissions now uses sudo when required

This commit is contained in:
jash
2018-11-04 17:51:45 +01:00
committed by kexkey
parent 3825cecb40
commit f5bcfe5089

10
dist/setup.sh vendored
View File

@@ -121,7 +121,15 @@ modify_permissions() {
do
if [[ -e $d ]]; then
step " modify permissions: $d"
try chmod -R og-rwx $d
if [[ $SUDO_REQUIRED ]]; then
if [[ $(id -u) == 0 ]]; then
try chmod -R og-rwx $d
else
try sudo chmod -R og-rwx $d
fi
else
try chmod -R og-rwx $d
fi
next
fi
done