Browse Source

Move user permissions function to utils

Bob Mottram 8 years ago
parent
commit
96e8e5c796
2 changed files with 12 additions and 12 deletions
  1. 0
    11
      src/freedombone-restore-local
  2. 12
    1
      src/freedombone-utils-backup

+ 0
- 11
src/freedombone-restore-local View File

@@ -76,17 +76,6 @@ GIT_DOMAIN_NAME=
76 76
 WIKI_DOMAIN_NAME=
77 77
 FULLBLOG_DOMAIN_NAME=
78 78
 
79
-# after user files have been restored permissions may need to be set
80
-function set_user_permissions {
81
-	echo $"Setting permissions"
82
-	for d in /home/*/ ; do
83
-		USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
84
-		if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then
85
-			chown -R $USERNAME:$USERNAME /home/$USERNAME
86
-		fi
87
-	done
88
-}
89
-
90 79
 function check_backup_exists {
91 80
 	if [ ! -d $USB_MOUNT/backup ]; then
92 81
 		echo $"No backup directory found on the USB drive."

+ 12
- 1
src/freedombone-utils-backup View File

@@ -131,7 +131,7 @@ function backup_mount_drive {
131 131
 	if [ $3 ]; then
132 132
 		RESTORE_APP=$3
133 133
 	fi
134
-	
134
+
135 135
 	# check that the backup destination is available
136 136
 	if [ ! -b $USB_DRIVE ]; then
137 137
 		echo $"Please attach a USB drive"
@@ -270,4 +270,15 @@ function backup_database_to_usb {
270 270
 	backup_directory_to_usb /root/temp${database_name}data ${database_name}data
271 271
 }
272 272
 
273
+# after user files have been restored permissions may need to be set
274
+function set_user_permissions {
275
+	echo $"Setting permissions"
276
+	for d in /home/*/ ; do
277
+		USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
278
+		if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then
279
+			chown -R $USERNAME:$USERNAME /home/$USERNAME
280
+		fi
281
+	done
282
+}
283
+
273 284
 # NOTE: deliberately no exit 0