Share version information between client and server scripts and update to 0.2.3

This commit is contained in:
Janek Bevendorff 2015-10-14 19:11:46 +02:00
parent 876a1968da
commit 8b7a244c27
3 changed files with 35 additions and 11 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
## ##
# Copyright (C) 2013-2014 Janek Bevendorff # Copyright (C) 2013-2015 Janek Bevendorff
# Website: http://www.refining-linux.org/ # Website: http://www.refining-linux.org/
# #
# Script to push backups to a remote rsync backup server. # Script to push backups to a remote rsync backup server.
@ -40,7 +40,7 @@
# Additional internal config # Additional internal config
############################################################################### ###############################################################################
_VERSION=0.2.2 _VERSION=$(rs-version version)
_GLOBAL_INCLUSION_PATTERN_FILE="/etc/rs-backup/include-files" _GLOBAL_INCLUSION_PATTERN_FILE="/etc/rs-backup/include-files"
_FORCED_INCLUSION_PATTERN_FILE="" _FORCED_INCLUSION_PATTERN_FILE=""
_SKIP_HOME_DIRS=false _SKIP_HOME_DIRS=false
@ -67,10 +67,9 @@ fi
# #
# Usage: print_help # Usage: print_help
print_help() { print_help() {
rs-version headline rs-backup-run
rs-version copyright
cat << HELP cat << HELP
rs-backup-run version ${_VERSION}
Copyright (C) 2013-2014 by Janek Bevendorff
Web site: http://www.refining-linux.org/
Push backup to rsync backup server over SSH. Push backup to rsync backup server over SSH.

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
## ##
# Copyright (C) 2013-2014 Janek Bevendorff # Copyright (C) 2013-2015 Janek Bevendorff
# Website: http://www.refining-linux.org/ # Website: http://www.refining-linux.org/
# #
# Install script for installing server and client script files # Install script for installing server and client script files
@ -27,7 +27,9 @@
## ##
if [[ "$1" != "all" ]] && [[ "$1" != "client" ]] && [[ "$1" != "server" ]]; then if [[ "$1" != "all" ]] && [[ "$1" != "client" ]] && [[ "$1" != "server" ]]; then
./server/usr/bin/rs-version ./server/usr/bin/rs-version headline "rs-backup-suite installer"
./server/usr/bin/rs-version copyright
echo
echo "Usage: $(basename $0) [all|server|client]" echo "Usage: $(basename $0) [all|server|client]"
exit exit
fi fi
@ -203,6 +205,7 @@ if [[ $MODE == "install" ]]; then
echo "Installing client component..." echo "Installing client component..."
$CP ./client/usr/bin/* /usr/bin/ $CP ./client/usr/bin/* /usr/bin/
$CP ./server/usr/bin/rs-version /usr/bin/
# Do not overwrite existing config # Do not overwrite existing config
if [ ! -e /etc/rs-backup/client-config ]; then if [ ! -e /etc/rs-backup/client-config ]; then

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
## ##
# Copyright (C) 2013-2014 Janek Bevendorff # Copyright (C) 2013-2015 Janek Bevendorff
# Website: http://www.refining-linux.org/ # Website: http://www.refining-linux.org/
# #
# Print out version and copyright information for rs-backup. # Print out version and copyright information for rs-backup.
@ -26,7 +26,29 @@
# THE SOFTWARE. # THE SOFTWARE.
## ##
VERSION="0.2.2" _VERSION="0.2.3"
echo -e "\e[1mrs-backup-suite\e[0m version ${VERSION}" headline() {
echo "Copyright (C) 2013-2014 Janek Bevendorff" if [ "$1" != "" ]; then
component="$1"
else
component="rs-backup-suite"
fi
echo -e "\e[1m${component}\e[0m version ${_VERSION}"
}
copyright() {
echo "Copyright (C) 2013-2015 Janek Bevendorff"
echo "Website: https://github.com/Manko10/rs-backup-suite"
}
if [ "$1" == "version" ]; then
echo -n "${_VERSION}"
elif [ "$1" == "headline" ]; then
headline "$2"
elif [ "$1" == "copyright" ]; then
copyright
else
headline
copyright
fi