1
0
mirror of https://github.com/deajan/obackup.git synced 2024-11-14 11:43:41 +01:00

Added cygwin to supported OS list

This commit is contained in:
deajan 2016-03-20 16:49:29 +01:00
parent 234fcd9887
commit c2675e125d
3 changed files with 48 additions and 23 deletions

View File

@ -8,7 +8,7 @@ PROGRAM_VERSION=2.0-pre
PROGRAM_BUILD=2016031801 PROGRAM_BUILD=2016031801
IS_STABLE=no IS_STABLE=no
## FUNC_BUILD=2016031401 ## FUNC_BUILD=2016032001
## BEGIN Generic functions for osync & obackup written in 2013-2016 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr ## BEGIN Generic functions for osync & obackup written in 2013-2016 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr
## type -p does not work on platforms other than linux (bash). If if does not work, always assume output is not a zero exitcode ## type -p does not work on platforms other than linux (bash). If if does not work, always assume output is not a zero exitcode
@ -410,13 +410,17 @@ function GetLocalOS {
*"BSD"*) *"BSD"*)
LOCAL_OS="BSD" LOCAL_OS="BSD"
;; ;;
*"MINGW32"*) *"MINGW32"*|*"CYGWIN"*)
LOCAL_OS="msys" LOCAL_OS="msys"
;; ;;
*"Darwin"*) *"Darwin"*)
LOCAL_OS="MacOSX" LOCAL_OS="MacOSX"
;; ;;
*) *)
if [ "$IGNORE_OS_TYPE" == "yes" ]; then #DOC: Undocumented option
Logger "Running on unknown local OS." "WARN"
return
fi
Logger "Running on >> $local_os_var << not supported. Please report to the author." "ERROR" Logger "Running on >> $local_os_var << not supported. Please report to the author." "ERROR"
exit 1 exit 1
;; ;;
@ -466,7 +470,7 @@ function GetRemoteOS {
*"BSD"*) *"BSD"*)
REMOTE_OS="BSD" REMOTE_OS="BSD"
;; ;;
*"MINGW32"*) *"MINGW32"*|*"CYGWIN"*)
REMOTE_OS="msys" REMOTE_OS="msys"
;; ;;
*"Darwin"*) *"Darwin"*)
@ -477,6 +481,10 @@ function GetRemoteOS {
exit 1 exit 1
;; ;;
*) *)
if [ "$IGNORE_OS_VER" == "yes" ]; then #DOC: Undocumented option
Logger "Running on unknown remote OS." "WARN"
return
fi
Logger "Running on remote OS failed. Please report to the author if the OS is not supported." "CRITICAL" Logger "Running on remote OS failed. Please report to the author if the OS is not supported." "CRITICAL"
Logger "Remote OS said:\n$remote_os_var" "CRITICAL" Logger "Remote OS said:\n$remote_os_var" "CRITICAL"
exit 1 exit 1

View File

@ -3,7 +3,7 @@
PROGRAM=obackup PROGRAM=obackup
PROGRAM_BINARY=$PROGRAM".sh" PROGRAM_BINARY=$PROGRAM".sh"
PROGRAM_BATCH=$PROGRAM"-batch.sh" PROGRAM_BATCH=$PROGRAM"-batch.sh"
SCRIPT_BUILD=2016031401 SCRIPT_BUILD=2016031502
## osync / obackup daemon install script ## osync / obackup daemon install script
## Tested on RHEL / CentOS 6 & 7, Fedora 23, Debian 7 & 8, Mint 17 and FreeBSD 8 & 10 ## Tested on RHEL / CentOS 6 & 7, Fedora 23, Debian 7 & 8, Mint 17 and FreeBSD 8 & 10
@ -42,36 +42,45 @@ if [ -f "./exlude.list.example" ]; then
cp "./exclude.list.example" "/etc/$PROGRAM" cp "./exclude.list.example" "/etc/$PROGRAM"
fi fi
if [ -f "./snapshot.conf" ]; then
cp "./snapshot.conf" "/etc/$PROGRAM/snapshot.conf.example"
fi
cp "./$PROGRAM_BINARY" "$BIN_DIR" cp "./$PROGRAM_BINARY" "$BIN_DIR"
if [ $? != 0 ]; then if [ $? != 0 ]; then
echo "Cannot copy $PROGRAM_BINARY to [$BIN_DIR]." echo "Cannot copy $PROGRAM_BINARY to [$BIN_DIR]."
else else
chmod 755 "$BIN_DIR/$PROGRAM_BINARY"
echo "Copied $PROGRAM_BINARY to [$BIN_DIR]." echo "Copied $PROGRAM_BINARY to [$BIN_DIR]."
fi fi
cp "./$PROGRAM_BATCH" "/usr/local/bin"
if [ -f "./$PROGRAM_BATCH" ]; then
cp "./$PROGRAM_BATCH" "$BIN_DIR"
if [ $? != 0 ]; then if [ $? != 0 ]; then
echo "Cannot copy $PROGRAM_BATCH to [$BIN_DIR]." echo "Cannot copy $PROGRAM_BATCH to [$BIN_DIR]."
else else
chmod 755 "$BIN_DIR/$PROGRAM_BATCH"
echo "Copied $PROGRAM_BATCH to [$BIN_DIR]." echo "Copied $PROGRAM_BATCH to [$BIN_DIR]."
fi fi
cp "./ssh_filter.sh" "/usr/local/bin" fi
if [ -f "./ssh_filter.sh" ]; then
cp "./ssh_filter.sh" "$BIN_DIR"
if [ $? != 0 ]; then if [ $? != 0 ]; then
echo "Cannot copy ssh_filter.sh to [$BIN_DIR]." echo "Cannot copy ssh_filter.sh to [$BIN_DIR]."
else else
chmod 755 "$BIN_DIR/ssh_filter.sh"
chown root:root "$BIN_DIR/ssh_filter.sh"
echo "Copied ssh_filter.sh to [$BIN_DIR]." echo "Copied ssh_filter.sh to [$BIN_DIR]."
fi fi
fi
if [ -f "./osync-srv" ]; then if [ -f "./osync-srv" ]; then
cp "./osync-srv" "$SERVICE_DIR" cp "./osync-srv" "$SERVICE_DIR"
if [ $? != 0 ]; then if [ $? != 0 ]; then
echo "Cannot copy osync-srv to [$SERVICE_DIR]." echo "Cannot copy osync-srv to [$SERVICE_DIR]."
else else
chmod 755 "$SERVICE_DIR/osync-srv"
echo "Created osync-srv service in [$SERVICE_DIR]." echo "Created osync-srv service in [$SERVICE_DIR]."
chmod 755 "/etc/init.d/osync-srv"
fi fi
fi fi
chmod 755 "/usr/local/bin/$PROGRAM_BINARY"
chmod 755 "/usr/local/bin/$PROGRAM_BATCH"
chmod 755 "/usr/local/bin/ssh_filter.sh"
chown root:root "/usr/local/bin/ssh_filter.sh"

View File

@ -8,7 +8,7 @@ PROGRAM_VERSION=2.0-pre
PROGRAM_BUILD=2016031801 PROGRAM_BUILD=2016031801
IS_STABLE=no IS_STABLE=no
## FUNC_BUILD=2016031401 ## FUNC_BUILD=2016032001
## BEGIN Generic functions for osync & obackup written in 2013-2016 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr ## BEGIN Generic functions for osync & obackup written in 2013-2016 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr
## type -p does not work on platforms other than linux (bash). If if does not work, always assume output is not a zero exitcode ## type -p does not work on platforms other than linux (bash). If if does not work, always assume output is not a zero exitcode
@ -396,13 +396,17 @@ function GetLocalOS {
*"BSD"*) *"BSD"*)
LOCAL_OS="BSD" LOCAL_OS="BSD"
;; ;;
*"MINGW32"*) *"MINGW32"*|*"CYGWIN"*)
LOCAL_OS="msys" LOCAL_OS="msys"
;; ;;
*"Darwin"*) *"Darwin"*)
LOCAL_OS="MacOSX" LOCAL_OS="MacOSX"
;; ;;
*) *)
if [ "$IGNORE_OS_TYPE" == "yes" ]; then #DOC: Undocumented option
Logger "Running on unknown local OS." "WARN"
return
fi
Logger "Running on >> $local_os_var << not supported. Please report to the author." "ERROR" Logger "Running on >> $local_os_var << not supported. Please report to the author." "ERROR"
exit 1 exit 1
;; ;;
@ -451,7 +455,7 @@ function GetRemoteOS {
*"BSD"*) *"BSD"*)
REMOTE_OS="BSD" REMOTE_OS="BSD"
;; ;;
*"MINGW32"*) *"MINGW32"*|*"CYGWIN"*)
REMOTE_OS="msys" REMOTE_OS="msys"
;; ;;
*"Darwin"*) *"Darwin"*)
@ -462,6 +466,10 @@ function GetRemoteOS {
exit 1 exit 1
;; ;;
*) *)
if [ "$IGNORE_OS_VER" == "yes" ]; then #DOC: Undocumented option
Logger "Running on unknown remote OS." "WARN"
return
fi
Logger "Running on remote OS failed. Please report to the author if the OS is not supported." "CRITICAL" Logger "Running on remote OS failed. Please report to the author if the OS is not supported." "CRITICAL"
Logger "Remote OS said:\n$remote_os_var" "CRITICAL" Logger "Remote OS said:\n$remote_os_var" "CRITICAL"
exit 1 exit 1