|
|
|
@ -2,8 +2,6 @@
|
|
|
|
|
|
|
|
|
|
## Installer script suitable for osync / obackup / pmocr
|
|
|
|
|
|
|
|
|
|
include #### _OFUNCTIONS_BOOTSTRAP SUBSET ####
|
|
|
|
|
|
|
|
|
|
PROGRAM=[prgname]
|
|
|
|
|
|
|
|
|
|
PROGRAM_VERSION=$(grep "PROGRAM_VERSION=" $PROGRAM.sh)
|
|
|
|
@ -12,12 +10,15 @@ PROGRAM_BINARY=$PROGRAM".sh"
|
|
|
|
|
PROGRAM_BATCH=$PROGRAM"-batch.sh"
|
|
|
|
|
SSH_FILTER="ssh_filter.sh"
|
|
|
|
|
|
|
|
|
|
SCRIPT_BUILD=2018070201
|
|
|
|
|
SCRIPT_BUILD=2018090301
|
|
|
|
|
INSTANCE_ID="installer-$SCRIPT_BUILD"
|
|
|
|
|
|
|
|
|
|
## 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
|
|
|
|
|
## Please adapt this to fit your distro needs
|
|
|
|
|
|
|
|
|
|
include #### _OFUNCTIONS_BOOTSTRAP SUBSET ####
|
|
|
|
|
|
|
|
|
|
# Get current install.sh path from http://stackoverflow.com/a/246128/2635443
|
|
|
|
|
SCRIPT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
|
|
|
|
|
@ -85,6 +86,15 @@ else
|
|
|
|
|
LOG_FILE="./$PROGRAM-install.log"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
## Default directory where to store temporary run files
|
|
|
|
|
if [ -w /tmp ]; then
|
|
|
|
|
RUN_DIR=/tmp
|
|
|
|
|
elif [ -w /var/tmp ]; then
|
|
|
|
|
RUN_DIR=/var/tmp
|
|
|
|
|
else
|
|
|
|
|
RUN_DIR=.
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
include #### Logger SUBSET ####
|
|
|
|
|
include #### UrlEncode SUBSET ####
|
|
|
|
|
include #### GetLocalOS SUBSET ####
|
|
|
|
@ -344,6 +354,26 @@ function Usage {
|
|
|
|
|
exit 127
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
############################## Script entry point
|
|
|
|
|
|
|
|
|
|
if [ "$LOGFILE" == "" ]; then
|
|
|
|
|
if [ -w /var/log ]; then
|
|
|
|
|
LOG_FILE="/var/log/$PROGRAM.$INSTANCE_ID.log"
|
|
|
|
|
elif ([ "$HOME" != "" ] && [ -w "$HOME" ]); then
|
|
|
|
|
LOG_FILE="$HOME/$PROGRAM.$INSTANCE_ID.log"
|
|
|
|
|
else
|
|
|
|
|
LOG_FILE="./$PROGRAM.$INSTANCE_ID.log"
|
|
|
|
|
fi
|
|
|
|
|
else
|
|
|
|
|
LOG_FILE="$LOGFILE"
|
|
|
|
|
fi
|
|
|
|
|
if [ ! -w "$(dirname $LOG_FILE)" ]; then
|
|
|
|
|
echo "Cannot write to log [$(dirname $LOG_FILE)]."
|
|
|
|
|
else
|
|
|
|
|
Logger "Script begin, logging to [$LOG_FILE]." "DEBUG"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GetLocalOS
|
|
|
|
|
SetLocalOSSettings
|
|
|
|
|
GetInit
|
|
|
|
|