Move user permissions function to utils
This commit is contained in:
parent
6754e540fd
commit
96e8e5c796
|
@ -76,17 +76,6 @@ GIT_DOMAIN_NAME=
|
|||
WIKI_DOMAIN_NAME=
|
||||
FULLBLOG_DOMAIN_NAME=
|
||||
|
||||
# after user files have been restored permissions may need to be set
|
||||
function set_user_permissions {
|
||||
echo $"Setting permissions"
|
||||
for d in /home/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
|
||||
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then
|
||||
chown -R $USERNAME:$USERNAME /home/$USERNAME
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
function check_backup_exists {
|
||||
if [ ! -d $USB_MOUNT/backup ]; then
|
||||
echo $"No backup directory found on the USB drive."
|
||||
|
|
|
@ -270,4 +270,15 @@ function backup_database_to_usb {
|
|||
backup_directory_to_usb /root/temp${database_name}data ${database_name}data
|
||||
}
|
||||
|
||||
# after user files have been restored permissions may need to be set
|
||||
function set_user_permissions {
|
||||
echo $"Setting permissions"
|
||||
for d in /home/*/ ; do
|
||||
USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
|
||||
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then
|
||||
chown -R $USERNAME:$USERNAME /home/$USERNAME
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# NOTE: deliberately no exit 0
|
||||
|
|
Loading…
Reference in New Issue