Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NoCloud-Auto-Installer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
NoCloud
NoCloud-Auto-Installer
Commits
fd0d446e
Verified
Commit
fd0d446e
authored
7 years ago
by
David Beniamine
Browse files
Options
Downloads
Patches
Plain Diff
Avoid upgrade preparation if no upgrade available
parent
ac778714
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
upgradeNextcloud.sh
+33
-0
33 additions, 0 deletions
upgradeNextcloud.sh
with
33 additions
and
0 deletions
upgradeNextcloud.sh
+
33
−
0
View file @
fd0d446e
...
@@ -22,11 +22,44 @@ htuser=${htuser:-'www-data'}
...
@@ -22,11 +22,44 @@ htuser=${htuser:-'www-data'}
ocupdater
=
${
ocupdater
:-
"
$NEXTCLOUD_INSTALL_DIR
/updater/updater.phar"
}
ocupdater
=
${
ocupdater
:-
"
$NEXTCLOUD_INSTALL_DIR
/updater/updater.phar"
}
occ
=
$NEXTCLOUD_INSTALL_DIR
/occ
occ
=
$NEXTCLOUD_INSTALL_DIR
/occ
APPS
=
`
sudo
-u
$htuser
php
$occ
app:list |
awk
'BEGIN{ok=1} /^Disabled:/{ok=0} {if(ok==1){print $2}}'
|
sed
's/:$//'
`
APPS
=
`
sudo
-u
$htuser
php
$occ
app:list |
awk
'BEGIN{ok=1} /^Disabled:/{ok=0} {if(ok==1){print $2}}'
|
sed
's/:$//'
`
if
[
!
-d
$NEXTCLOUD_INSTALL_DIR
]
if
[
!
-d
$NEXTCLOUD_INSTALL_DIR
]
then
then
echo
"Nextcloud is not installed, aborting"
echo
"Nextcloud is not installed, aborting"
exit
1
exit
1
fi
fi
if
[
-z
$MAINTENANCE_LEVEL
]
then
echo
"Maintenance level cannot be detected, please update your main.env"
exit
1
fi
current_vesion
=
`
sudo
-u
www-data php /var/www/nextcloud/occ status
\
|
awk
'/versionstring/{print $3}'
`
echo
"Nextclous is installed, version
$current_vesion
"
if
[
$MAINTENANCE_LEVEL
==
"upgrade"
]
then
echo
"Checking version from changelog page (upgrade)"
target_version
=
`
curl
-silent
https://nextcloud.com/changelog/
\
|
sed
's/>/>\n/g'
|
awk
'/^<h3 id=/{print $2}'
|
head
-n
1
\
|
sed
-e
's/id="\(.*\)">/\1/'
-e
's/-/./g'
`
else
echo
"Checking version from install page (security)"
target_version
=
`
curl
-silent
\
'https://nextcloud.com/install/#instructions-server'
\
|
sed
's/>/>\n/g'
|
awk
'/href=.*server\/release/{print $0}'
\
|
head
-n
1 |
sed
's/.*nextcloud-\(.*\).zip">/\1/'
`
fi
echo
"Upstream version is :
$target_version
"
if
[
"
$current_vesion
"
==
"
$target_version
"
]
then
echo
"Nextcloud is already up to date"
exit
0
fi
echo
"Removing old backup"
echo
"Removing old backup"
rm
-rf
$NEXTCLOUD_INSTALL_DIR
.bak
rm
-rf
$NEXTCLOUD_INSTALL_DIR
.bak
echo
"backing up nextcloud"
echo
"backing up nextcloud"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment