Be able to create /usr/local/bin

This commit is contained in:
deajan 2017-02-07 23:39:20 +01:00
parent 48f9cfc973
commit ce9ddee19d
1 changed files with 10 additions and 9 deletions

View File

@ -8,7 +8,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=2017020703 SCRIPT_BUILD=2017020704
## osync / obackup / pmocr / zsnap install script ## osync / obackup / pmocr / zsnap install script
## Tested on RHEL / CentOS 6 & 7, Fedora 23, Debian 7 & 8, Mint 17 and FreeBSD 8, 10 and 11 ## Tested on RHEL / CentOS 6 & 7, Fedora 23, Debian 7 & 8, Mint 17 and FreeBSD 8, 10 and 11
@ -97,17 +97,17 @@ function GetInit {
fi fi
} }
function CreateConfDir { function CreateDir {
if [ ! -d "$CONF_DIR" ]; then local dir="${1}"
mkdir "$CONF_DIR"
if [ ! -d "$dir" ]; then
mkdir "$dir"
if [ $? == 0 ]; then if [ $? == 0 ]; then
QuickLogger "Created directory [$CONF_DIR]." QuickLogger "Created directory [$dir]."
else else
QuickLogger "Cannot create directory [$CONF_DIR]." QuickLogger "Cannot create directory [$dir]."
exit 1 exit 1
fi fi
else
QuickLogger "Config directory [$CONF_DIR] exists."
fi fi
} }
@ -309,7 +309,8 @@ if [ "$ACTION" == "uninstall" ]; then
RemoveAll RemoveAll
QuickLogger "$PROGRAM uninstalled." QuickLogger "$PROGRAM uninstalled."
else else
CreateConfDir CreateDir "$CONF_DIR"
CreateDir "$BIN_DIR"
CopyExampleFiles CopyExampleFiles
CopyProgram CopyProgram
CopyServiceFiles CopyServiceFiles