diff --git a/dist/setup.sh b/dist/setup.sh index 041f605..9b67f32 100755 --- a/dist/setup.sh +++ b/dist/setup.sh @@ -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