mirror of
https://github.com/aljazceru/cyphernode.git
synced 2025-12-26 09:05:13 +01:00
modify permissions now uses sudo when required
This commit is contained in:
10
dist/setup.sh
vendored
10
dist/setup.sh
vendored
@@ -121,7 +121,15 @@ modify_permissions() {
|
||||
do
|
||||
if [[ -e $d ]]; then
|
||||
step " [32mmodify[0m 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
|
||||
|
||||
Reference in New Issue
Block a user