mirror of
https://github.com/EV21/uberspace-helper.git
synced 2026-10-08 04:43:18 +02:00
Compare commits
2
Commits
ee5d32045c
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c38a5ce166
|
||
|
|
6541a32fb9
|
No files matched your search
+4
-4
@@ -202,9 +202,9 @@ DEFAULT_KEEP_EMAIL_PRIVATE = true
|
|||||||
NO_REPLY_ADDRESS = noreply.${USER}.uber.space
|
NO_REPLY_ADDRESS = noreply.${USER}.uber.space
|
||||||
|
|
||||||
[mailer]
|
[mailer]
|
||||||
ENABLED = true
|
ENABLED = true
|
||||||
MAILER_TYPE = sendmail
|
PROTOCOL = sendmail
|
||||||
FROM = ${USER}@uber.space
|
FROM = ${USER}@uber.space
|
||||||
|
|
||||||
[other]
|
[other]
|
||||||
SHOW_FOOTER_VERSION = false
|
SHOW_FOOTER_VERSION = false
|
||||||
@@ -339,7 +339,7 @@ function verify_file
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# version_lower_than A B
|
# is_version_lower_than A B
|
||||||
# returns whether A < B
|
# returns whether A < B
|
||||||
function is_version_lower_than
|
function is_version_lower_than
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -68,7 +68,7 @@ function verify_file
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# version_lower_than A B
|
# is_version_lower_than A B
|
||||||
# returns whether A < B
|
# returns whether A < B
|
||||||
function is_version_lower_than
|
function is_version_lower_than
|
||||||
{
|
{
|
||||||
|
|||||||
+16
-8
@@ -6,7 +6,8 @@ LOCAL_VERSION=$(jq --raw-output .version ~/hedgedoc/package.json)
|
|||||||
LATEST_VERSION=$(curl --silent https://api.github.com/repos/$ORG/$REPO/releases/latest |
|
LATEST_VERSION=$(curl --silent https://api.github.com/repos/$ORG/$REPO/releases/latest |
|
||||||
jq --raw-output .tag_name)
|
jq --raw-output .tag_name)
|
||||||
|
|
||||||
function do_upgrade() {
|
function do_upgrade
|
||||||
|
{
|
||||||
supervisorctl stop hedgedoc
|
supervisorctl stop hedgedoc
|
||||||
echo "waiting 1 minute until all processes are stopped"
|
echo "waiting 1 minute until all processes are stopped"
|
||||||
sleep 1m
|
sleep 1m
|
||||||
@@ -26,7 +27,7 @@ function do_upgrade() {
|
|||||||
rm --recursive ~/hedgedoc_"$LOCAL_VERSION"
|
rm --recursive ~/hedgedoc_"$LOCAL_VERSION"
|
||||||
}
|
}
|
||||||
|
|
||||||
function yes-no_question
|
function yes_no_question
|
||||||
{
|
{
|
||||||
local question=$1
|
local question=$1
|
||||||
while true
|
while true
|
||||||
@@ -45,9 +46,9 @@ function yes-no_question
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
## version_lower_than A B
|
# is_version_lower_than A B
|
||||||
# returns whether A < B
|
# returns whether A < B
|
||||||
function version_lower_than
|
function is_version_lower_than
|
||||||
{
|
{
|
||||||
test "$(echo "$@" |
|
test "$(echo "$@" |
|
||||||
tr " " "\n" |
|
tr " " "\n" |
|
||||||
@@ -55,11 +56,17 @@ function version_lower_than
|
|||||||
head --lines=1)" != "$1"
|
head --lines=1)" != "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function is_update_available
|
||||||
|
{
|
||||||
|
if is_version_lower_than "$LOCAL_VERSION" "$LATEST_VERSION"
|
||||||
|
then return 0
|
||||||
|
else return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
function main
|
function main
|
||||||
{
|
{
|
||||||
if [ "$LOCAL_VERSION" = "$LATEST_VERSION" ]
|
if is_update_available
|
||||||
then echo "Your HedgeDoc is already up to date."
|
|
||||||
elif version_lower_than "$LOCAL_VERSION" "$LATEST_VERSION"
|
|
||||||
then
|
then
|
||||||
echo "There is a new Version available of $APP_NAME"
|
echo "There is a new Version available of $APP_NAME"
|
||||||
echo "The latest Version is $LATEST_VERSION"
|
echo "The latest Version is $LATEST_VERSION"
|
||||||
@@ -68,9 +75,10 @@ function main
|
|||||||
echo "Please read the release notes."
|
echo "Please read the release notes."
|
||||||
echo "Also check if the upgrade instructions have changed."
|
echo "Also check if the upgrade instructions have changed."
|
||||||
echo "Your instance might break."
|
echo "Your instance might break."
|
||||||
if yes-no_question "Do you wish to proceed with the upgrade?"
|
if yes_no_question "Do you wish to proceed with the upgrade?"
|
||||||
then do_upgrade
|
then do_upgrade
|
||||||
fi
|
fi
|
||||||
|
else echo "Your HedgeDoc is already up to date."
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user