소스 검색

Move user permissions function to utils

Bob Mottram 8 년 전
부모
커밋
96e8e5c796
2개의 변경된 파일12개의 추가작업 그리고 12개의 파일을 삭제
  1. 0
    11
      src/freedombone-restore-local
  2. 12
    1
      src/freedombone-utils-backup

+ 0
- 11
src/freedombone-restore-local 파일 보기

76
 WIKI_DOMAIN_NAME=
76
 WIKI_DOMAIN_NAME=
77
 FULLBLOG_DOMAIN_NAME=
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
 function check_backup_exists {
79
 function check_backup_exists {
91
 	if [ ! -d $USB_MOUNT/backup ]; then
80
 	if [ ! -d $USB_MOUNT/backup ]; then
92
 		echo $"No backup directory found on the USB drive."
81
 		echo $"No backup directory found on the USB drive."

+ 12
- 1
src/freedombone-utils-backup 파일 보기

131
 	if [ $3 ]; then
131
 	if [ $3 ]; then
132
 		RESTORE_APP=$3
132
 		RESTORE_APP=$3
133
 	fi
133
 	fi
134
-	
134
+
135
 	# check that the backup destination is available
135
 	# check that the backup destination is available
136
 	if [ ! -b $USB_DRIVE ]; then
136
 	if [ ! -b $USB_DRIVE ]; then
137
 		echo $"Please attach a USB drive"
137
 		echo $"Please attach a USB drive"
270
 	backup_directory_to_usb /root/temp${database_name}data ${database_name}data
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
 # NOTE: deliberately no exit 0
284
 # NOTE: deliberately no exit 0