From 8b7a244c270a3c0f60a8836f152b21fc11772935 Mon Sep 17 00:00:00 2001 From: Janek Bevendorff Date: Wed, 14 Oct 2015 19:11:46 +0200 Subject: [PATCH] Share version information between client and server scripts and update to 0.2.3 --- client/usr/bin/rs-backup-run | 9 ++++----- install.sh | 7 +++++-- server/usr/bin/rs-version | 30 ++++++++++++++++++++++++++---- 3 files changed, 35 insertions(+), 11 deletions(-) diff --git a/client/usr/bin/rs-backup-run b/client/usr/bin/rs-backup-run index b98e6fc..f92791d 100755 --- a/client/usr/bin/rs-backup-run +++ b/client/usr/bin/rs-backup-run @@ -1,6 +1,6 @@ #!/bin/bash ## -# Copyright (C) 2013-2014 Janek Bevendorff +# Copyright (C) 2013-2015 Janek Bevendorff # Website: http://www.refining-linux.org/ # # Script to push backups to a remote rsync backup server. @@ -40,7 +40,7 @@ # Additional internal config ############################################################################### -_VERSION=0.2.2 +_VERSION=$(rs-version version) _GLOBAL_INCLUSION_PATTERN_FILE="/etc/rs-backup/include-files" _FORCED_INCLUSION_PATTERN_FILE="" _SKIP_HOME_DIRS=false @@ -67,10 +67,9 @@ fi # # Usage: print_help print_help() { + rs-version headline rs-backup-run + rs-version copyright 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. diff --git a/install.sh b/install.sh index 6cf1e2b..57f1b1c 100755 --- a/install.sh +++ b/install.sh @@ -1,6 +1,6 @@ #!/bin/sh ## -# Copyright (C) 2013-2014 Janek Bevendorff +# Copyright (C) 2013-2015 Janek Bevendorff # Website: http://www.refining-linux.org/ # # Install script for installing server and client script files @@ -27,7 +27,9 @@ ## 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]" exit fi @@ -203,6 +205,7 @@ if [[ $MODE == "install" ]]; then echo "Installing client component..." $CP ./client/usr/bin/* /usr/bin/ + $CP ./server/usr/bin/rs-version /usr/bin/ # Do not overwrite existing config if [ ! -e /etc/rs-backup/client-config ]; then diff --git a/server/usr/bin/rs-version b/server/usr/bin/rs-version index ee56b09..22ad140 100755 --- a/server/usr/bin/rs-version +++ b/server/usr/bin/rs-version @@ -1,6 +1,6 @@ #!/bin/sh ## -# Copyright (C) 2013-2014 Janek Bevendorff +# Copyright (C) 2013-2015 Janek Bevendorff # Website: http://www.refining-linux.org/ # # Print out version and copyright information for rs-backup. @@ -26,7 +26,29 @@ # THE SOFTWARE. ## -VERSION="0.2.2" +_VERSION="0.2.3" -echo -e "\e[1mrs-backup-suite\e[0m version ${VERSION}" -echo "Copyright (C) 2013-2014 Janek Bevendorff" \ No newline at end of file +headline() { + 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 \ No newline at end of file