From 541575d36e83f2672994bb63ae41bcaaa079e63f Mon Sep 17 00:00:00 2001 From: None Date: Fri, 30 Jun 2017 09:55:35 -0400 Subject: [PATCH] Permissions / ownership tweaks. --- config/scripts/post-config.d/hooks.sh | 7 +++++-- config/user-data/hooks/03-edgerouter-backup.sh | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/config/scripts/post-config.d/hooks.sh b/config/scripts/post-config.d/hooks.sh index 3242b17..176a43e 100644 --- a/config/scripts/post-config.d/hooks.sh +++ b/config/scripts/post-config.d/hooks.sh @@ -1,9 +1,12 @@ #!/bin/bash source /config/user-data/edgerouter-backup.conf -# Fix ownership -sudo chown -R root:vyattacfg /config/userdata +# Fix ownership / permissions +sudo chown -R root:vyattacfg /config/user-data sudo chown -R root:vyattacfg /config/scripts +sudo chmod -R ug+w /config/user-data +sudo chmod -R ug+w /config/scripts +sudo chmod g-w $SSH_KEYFILE # Ensure scripts are executable sudo chmod +x /config/user-data/hooks/* diff --git a/config/user-data/hooks/03-edgerouter-backup.sh b/config/user-data/hooks/03-edgerouter-backup.sh index 02d4ba2..ef33ac9 100644 --- a/config/user-data/hooks/03-edgerouter-backup.sh +++ b/config/user-data/hooks/03-edgerouter-backup.sh @@ -26,9 +26,9 @@ GIT_COMMIT_MSG="$COMMIT_CMT | by $USER | via $COMMIT_VIA | $TIME" # Remove temporary files #echo "edgerouter-backup: Removing temporary files" -sudo rm /tmp/edgerouter-backup-$FNAME_CONFIG -sudo rm /tmp/edgerouter-backup-$FNAME_CLI -sudo rm /tmp/edgerouter-backup-$FNAME_BACKUP +sudo rm /tmp/edgerouter-backup-$FNAME_CONFIG &> /dev/null +sudo rm /tmp/edgerouter-backup-$FNAME_CLI &> /dev/null +sudo rm /tmp/edgerouter-backup-$FNAME_BACKUP &> /dev/null # Generate temporary config files