From 5adba4e61ce72d1354a5e62d1522f17c3c18702d Mon Sep 17 00:00:00 2001 From: efelon Date: Mon, 17 Feb 2020 09:57:25 +0100 Subject: [PATCH] Work on help output --- seqs/gitea.sh | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/seqs/gitea.sh b/seqs/gitea.sh index 964846a..29f3b23 100755 --- a/seqs/gitea.sh +++ b/seqs/gitea.sh @@ -19,11 +19,15 @@ step_config() { } step_1_info() { echo "Updating apt"; } +step_1_alias() { ALIAS="install"; } step_1() { exe apt update } -step_2_info() { echo "Downloading $toolName to user home: $giteaDownload"; } +step_2_info() { + echo "Downloading $toolName to user home from:" + echoinfo "$giteaDownload" +} step_2() { exe wget -O ~/gitea $giteaDownload saveReturn $? @@ -78,7 +82,7 @@ step_6() { echo "Afterwards please execute step 20 to secure configuration" } -step_7_info() { echo "Show configuration notes"; } +step_7_info() { echo -e "Show configuration notes\n"; } step_7_alias() { ALIAS="config"; } step_7() { echo -e "Final configuration notes for app.ini:\n\n" @@ -141,11 +145,22 @@ step_10() { exe mysql -u root -e 'FLUSH PRIVILEGES;' } -step_12_info() { echo "Download new version $giteaVersion to /usr/local/bin"; } +step_12_info() { + if [ ! -z $versionNow ] ; then + if [ "$giteaVersion" == "$versionNow" ] ; then + echo "No upgrade available. Already on latest: $versionNow" + else + echo "Download new version $giteaVersion to /usr/local/bin" + echoinfo " - installed version: $versionNow -" + fi + else + echo "Download new version $giteaVersion to /usr/local/bin" + fi + echo +} step_12_alias() { ALIAS="upgrade"; } step_12() { if [ -f "$giteaLoc" ] ; then - local versionNow=$(gitea --version | sed 's/.*version \([0-9.]\+\).*/\1/') local toolBackup="${giteaDir}/gitea_${versionNow}" exe service gitea stop saveReturn $? @@ -157,6 +172,7 @@ step_12() { exe chmod +x "$giteaLoc" exe service gitea start } +versionNow=$(gitea --version | sed 's/.*version \([0-9.]\+\).*/\1/') step_20_info() { echo "Secure settings after installation"; } step_20() {