Fixed bogous CreateDir rights

This commit is contained in:
deajan 2018-10-02 23:06:33 +02:00
parent 6e7b99debb
commit 6c1b7a541b
1 changed files with 8 additions and 8 deletions

View File

@ -10,7 +10,7 @@ PROGRAM_BINARY=$PROGRAM".sh"
PROGRAM_BATCH=$PROGRAM"-batch.sh" PROGRAM_BATCH=$PROGRAM"-batch.sh"
SSH_FILTER="ssh_filter.sh" SSH_FILTER="ssh_filter.sh"
SCRIPT_BUILD=2018100204 SCRIPT_BUILD=2018100205
INSTANCE_ID="installer-$SCRIPT_BUILD" INSTANCE_ID="installer-$SCRIPT_BUILD"
## osync / obackup / pmocr / zsnap install script ## osync / obackup / pmocr / zsnap install script
@ -87,7 +87,6 @@ else
fi fi
include #### UrlEncode SUBSET #### include #### UrlEncode SUBSET ####
include #### IsInteger SUBSET ####
include #### GetLocalOS SUBSET #### include #### GetLocalOS SUBSET ####
include #### GetConfFileValue SUBSET #### include #### GetConfFileValue SUBSET ####
@ -159,8 +158,8 @@ function CreateDir {
fi fi
fi fi
if [ "$(IsNumeric $dirMod)" -eq 0 ]; then if [ "$(IsInteger $dirMod)" -eq 1 ]; then
chmod -R "$fileMod" "$dir" chmod -R "$dirMod" "$dir"
if [ $? != 0 ]; then if [ $? != 0 ]; then
Logger "Cannot set directory permissions of [$dir] to [$dirMod]." "SIMPLE" Logger "Cannot set directory permissions of [$dir] to [$dirMod]." "SIMPLE"
exit 1 exit 1
@ -170,12 +169,13 @@ function CreateDir {
elif [ "$fileMod" != "" ]; then elif [ "$fileMod" != "" ]; then
Logger "Bogus filemod [$fileMod] for [$destPath] given." "SIMPLE" Logger "Bogus filemod [$fileMod] for [$destPath] given." "SIMPLE"
fi fi
if [ "$dirUser" != "" ]; then
if [ "$dirUser" != "" ]; then
userGroup="$dirUser" userGroup="$dirUser"
if [ "$dirGroup" != "" ]; then if [ "$dirGroup" != "" ]; then
userGroup="$userGroup"":$dirGroup" userGroup="$userGroup"":$dirGroup"
fi fi
chown "$userGroup" "$dir" chown "$userGroup" "$dir"
if [ $? != 0 ]; then if [ $? != 0 ]; then
Logger "Could not set directory ownership on [$dir] to [$userGroup]." "SIMPLE" Logger "Could not set directory ownership on [$dir] to [$userGroup]." "SIMPLE"
exit 1 exit 1
@ -214,7 +214,7 @@ function CopyFile {
exit 1 exit 1
else else
Logger "Copied [$sourcePath/$sourceFileName] to [$destPath/$destFileName]." "SIMPLE" Logger "Copied [$sourcePath/$sourceFileName] to [$destPath/$destFileName]." "SIMPLE"
if [ "$(IsNumeric $fileMod)" -eq 0 ]; then if [ "$(IsInteger $fileMod)" -eq 1 ]; then
chmod "$fileMod" "$destPath/$destFileName" chmod "$fileMod" "$destPath/$destFileName"
if [ $? != 0 ]; then if [ $? != 0 ]; then
Logger "Cannot set file permissions of [$destPath/$destFileName] to [$fileMod]." "SIMPLE" Logger "Cannot set file permissions of [$destPath/$destFileName] to [$fileMod]." "SIMPLE"