mirror of
https://github.com/deajan/obackup.git
synced 2024-11-14 03:33:41 +01:00
Updated installer version logic
This commit is contained in:
parent
9474629d31
commit
375f5d413b
@ -1,14 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
## Installer script suitable for osync / obackup / pmocr
|
||||
|
||||
include #### _OFUNCTIONS_BOOTSTRAP SUBSET ####
|
||||
|
||||
PROGRAM=[prgname]
|
||||
PROGRAM_VERSION=[version]
|
||||
PROGRAM=osync
|
||||
|
||||
PROGRAM_VERSION=$(grep "PROGRAM_VERSION=" $PROGRAM.sh)
|
||||
PROGRAM_VERSION=${PROGRAM_VERSION#*=}
|
||||
PROGRAM_BINARY=$PROGRAM".sh"
|
||||
PROGRAM_BATCH=$PROGRAM"-batch.sh"
|
||||
SSH_FILTER="ssh_filter.sh"
|
||||
|
||||
SCRIPT_BUILD=2017021002
|
||||
SCRIPT_BUILD=2017031401
|
||||
|
||||
## 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
|
||||
@ -183,8 +187,10 @@ function CopyExampleFiles {
|
||||
function CopyProgram {
|
||||
binFiles=()
|
||||
binFiles[0]="$PROGRAM_BINARY"
|
||||
binFiles[1]="$PROGRAM_BATCH"
|
||||
binFiles[2]="$SSH_FILTER"
|
||||
if [ "$PROGRAM" == "osync" ] || [ "$PROGRAM" == "obackup" ]; then
|
||||
binFiles[1]="$PROGRAM_BATCH"
|
||||
binFiles[2]="$SSH_FILTER"
|
||||
fi
|
||||
|
||||
local user=""
|
||||
local group=""
|
||||
|
18
dev/merge.sh
18
dev/merge.sh
@ -1,15 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
## MERGE 2017020701
|
||||
## MERGE 2017031301
|
||||
|
||||
## Merges ofunctions.sh and n_program.sh into program.sh
|
||||
## Adds installer
|
||||
|
||||
function __PREPROCESSOR_Merge {
|
||||
PROGRAM=obackup
|
||||
|
||||
VERSION=$(grep "PROGRAM_VERSION=" n_$PROGRAM.sh)
|
||||
VERSION=${VERSION#*=}
|
||||
|
||||
__PREPROCESSOR_Constants
|
||||
|
||||
source "ofunctions.sh"
|
||||
@ -126,21 +126,21 @@ function __PREPROCESSOR_CleanDebug {
|
||||
}
|
||||
|
||||
function __PREPROCESSOR_CopyCommons {
|
||||
sed "s/\[prgname\]/$PROGRAM/g" common_install.sh > ../tmp_install.sh
|
||||
sed "s/\[prgname\]/$PROGRAM/g" common_install.sh > ../install.sh
|
||||
if [ $? != 0 ]; then
|
||||
QuickLogger "Cannot assemble install."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for subset in "${__PREPROCESSOR_SUBSETS[@]}"; do
|
||||
__PREPROCESSOR_MergeSubset "$subset" "${subset//SUBSET/SUBSET END}" "ofunctions.sh" "../tmp_install.sh"
|
||||
__PREPROCESSOR_MergeSubset "$subset" "${subset//SUBSET/SUBSET END}" "ofunctions.sh" "../install.sh"
|
||||
done
|
||||
|
||||
sed "s/\[version\]/$VERSION/g" ../tmp_install.sh > ../install.sh
|
||||
if [ $? != 0 ]; then
|
||||
QuickLogger "Cannot change install version."
|
||||
exit 1
|
||||
fi
|
||||
#sed "s/\[version\]/$VERSION/g" ../tmp_install.sh > ../install.sh
|
||||
#if [ $? != 0 ]; then
|
||||
# QuickLogger "Cannot change install version."
|
||||
# exit 1
|
||||
#fi
|
||||
if [ -f "common_batch.sh" ]; then
|
||||
sed "s/\[prgname\]/$PROGRAM/g" common_batch.sh > ../$PROGRAM-batch.sh
|
||||
if [ $? != 0 ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user