mirror of
https://github.com/deajan/obackup.git
synced 2025-01-12 15:13:53 +01:00
Added optional statistics for installer
This commit is contained in:
parent
6d410409a3
commit
a7e8487df3
@ -11,6 +11,7 @@ CHANGELOG
|
|||||||
README: FreeBSD execution needs mailer (not found), sudo missing, bash needed, sed missing (see if StripQuotes mandatory)
|
README: FreeBSD execution needs mailer (not found), sudo missing, bash needed, sed missing (see if StripQuotes mandatory)
|
||||||
|
|
||||||
! XX Mar 2016: obackup v2.0 released
|
! XX Mar 2016: obackup v2.0 released
|
||||||
|
- Added optional statistics for installer
|
||||||
- Added an option to ignore knownhosts for ssh connections (use with caution, this can lead to a security issue)
|
- Added an option to ignore knownhosts for ssh connections (use with caution, this can lead to a security issue)
|
||||||
- Improved mail fallback
|
- Improved mail fallback
|
||||||
- More logging enhancements
|
- More logging enhancements
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
## Merges ofunctions.sh and n_osync.sh into osync.sh
|
## Merges ofunctions.sh and n_osync.sh into osync.sh
|
||||||
|
|
||||||
PROGRAM=obackup
|
PROGRAM=obackup
|
||||||
|
VERSION=$(grep "PROGRAM_VERSION=" n_$PROGRAM.sh)
|
||||||
|
VERSION=${VERSION#*=}
|
||||||
FUNC_PATH=/home/git/common
|
FUNC_PATH=/home/git/common
|
||||||
|
|
||||||
PARANOIA_DEBUG_LINE="__WITH_PARANOIA_DEBUG"
|
PARANOIA_DEBUG_LINE="__WITH_PARANOIA_DEBUG"
|
||||||
@ -36,7 +38,8 @@ function CleanDebug {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function CopyCommons {
|
function CopyCommons {
|
||||||
sed "s/\[prgname\]/$PROGRAM/g" /home/git/common/common_install.sh > ../install.sh
|
sed "s/\[prgname\]/$PROGRAM/g" /home/git/common/common_install.sh > ../tmp_install.sh
|
||||||
|
sed "s/\[version\]/$VERSION/g" ../tmp_install.sh > ../install.sh
|
||||||
sed "s/\[prgname\]/$PROGRAM/g" /home/git/common/common_batch.sh > ../$PROGRAM-batch.sh
|
sed "s/\[prgname\]/$PROGRAM/g" /home/git/common/common_batch.sh > ../$PROGRAM-batch.sh
|
||||||
chmod +x ../install.sh
|
chmod +x ../install.sh
|
||||||
chmod +x ../obackup-batch.sh
|
chmod +x ../obackup-batch.sh
|
||||||
@ -46,4 +49,5 @@ Unexpand
|
|||||||
Merge
|
Merge
|
||||||
CleanDebug
|
CleanDebug
|
||||||
rm -f tmp_$PROGRAM.sh
|
rm -f tmp_$PROGRAM.sh
|
||||||
|
rm -f ../tmp_install.sh
|
||||||
CopyCommons
|
CopyCommons
|
||||||
|
29
install.sh
29
install.sh
@ -1,9 +1,10 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
PROGRAM=obackup
|
PROGRAM=obackup
|
||||||
|
PROGRAM_VERSION=2.0-pre
|
||||||
PROGRAM_BINARY=$PROGRAM".sh"
|
PROGRAM_BINARY=$PROGRAM".sh"
|
||||||
PROGRAM_BATCH=$PROGRAM"-batch.sh"
|
PROGRAM_BATCH=$PROGRAM"-batch.sh"
|
||||||
SCRIPT_BUILD=2016032202
|
SCRIPT_BUILD=2016032501
|
||||||
|
|
||||||
## 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
|
||||||
@ -32,7 +33,6 @@ case $local_os_var in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
if [ "$(whoami)" != "$USER" ]; then
|
if [ "$(whoami)" != "$USER" ]; then
|
||||||
echo "Must be run as $USER."
|
echo "Must be run as $USER."
|
||||||
exit 1
|
exit 1
|
||||||
@ -104,3 +104,28 @@ if [ -f "./osync-srv" ]; then
|
|||||||
echo "Created osync-srv service in [$SERVICE_DIR]."
|
echo "Created osync-srv service in [$SERVICE_DIR]."
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
function Statistics {
|
||||||
|
|
||||||
|
local link="http://instcount.netpower.fr?program=$PROGRAM&version=$PROGRAM_VERSION"
|
||||||
|
if type wget > /dev/null; then
|
||||||
|
wget $link > /dev/null 2>&1
|
||||||
|
elif type curl > /dev/null; then
|
||||||
|
curl $link > /dev/null 2>&1
|
||||||
|
else
|
||||||
|
echo "Neiter wget nor curl installed. Cannot run statistics. Use link below please."
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "$PROGRAM installed. Use with $BIN_DIR/$PROGRAM"
|
||||||
|
echo ""
|
||||||
|
echo "In order to make install statistics, the script would like to connect to http://instcount.netpower.fr?program=$PROGRAM&version=$PROGRAM_VERSION"
|
||||||
|
read -r -p "No data except those in the url will be send. Allow [Y/n]" response
|
||||||
|
case $response in
|
||||||
|
[nN])
|
||||||
|
exit
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
Statistics
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
Loading…
Reference in New Issue
Block a user