Work on help output

This commit is contained in:
2020-02-17 09:57:25 +01:00
parent a4c51b5ee3
commit 5adba4e61c

View File

@@ -19,11 +19,15 @@ step_config() {
} }
step_1_info() { echo "Updating apt"; } step_1_info() { echo "Updating apt"; }
step_1_alias() { ALIAS="install"; }
step_1() { step_1() {
exe apt update 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() { step_2() {
exe wget -O ~/gitea $giteaDownload exe wget -O ~/gitea $giteaDownload
saveReturn $? saveReturn $?
@@ -78,7 +82,7 @@ step_6() {
echo "Afterwards please execute step 20 to secure configuration" 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_alias() { ALIAS="config"; }
step_7() { step_7() {
echo -e "Final configuration notes for app.ini:\n\n" echo -e "Final configuration notes for app.ini:\n\n"
@@ -141,11 +145,22 @@ step_10() {
exe mysql -u root -e 'FLUSH PRIVILEGES;' 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_alias() { ALIAS="upgrade"; }
step_12() { step_12() {
if [ -f "$giteaLoc" ] ; then if [ -f "$giteaLoc" ] ; then
local versionNow=$(gitea --version | sed 's/.*version \([0-9.]\+\).*/\1/')
local toolBackup="${giteaDir}/gitea_${versionNow}" local toolBackup="${giteaDir}/gitea_${versionNow}"
exe service gitea stop exe service gitea stop
saveReturn $? saveReturn $?
@@ -157,6 +172,7 @@ step_12() {
exe chmod +x "$giteaLoc" exe chmod +x "$giteaLoc"
exe service gitea start exe service gitea start
} }
versionNow=$(gitea --version | sed 's/.*version \([0-9.]\+\).*/\1/')
step_20_info() { echo "Secure settings after installation"; } step_20_info() { echo "Secure settings after installation"; }
step_20() { step_20() {