Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etersoft-admin-essentials
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
etersoft-admin-essentials
Commits
f21cff0d
Commit
f21cff0d
authored
Feb 25, 2018
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add update-seafile-server.sh
parent
db16f8e1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
0 deletions
+56
-0
update-seafile-server.sh
utils/update-seafile-server.sh
+56
-0
No files found.
utils/update-seafile-server.sh
0 → 100755
View file @
f21cff0d
#!/bin/sh
VERSION
=
"
$1
"
fatal
()
{
echo
"
$@
"
>
&2
exit
1
}
major
()
{
echo
"
$1
"
|
sed
-e
"s|
\(
.*
\)\.
[0-9]|
\1
|g"
}
minor
()
{
echo
"
$1
"
|
sed
-e
"s|.*
\.\(
[0-9]
\)
|
\1
|g"
}
[
-n
"
$VERSION
"
]
||
fatal
"empty VERSION (run with version as arg)"
MAJOR
=
"
$(
major
$VERSION
)
"
PREV
=
"
$(
readlink
seafile-server-latest |
sed
-e
"s|seafile-server-
\(
.*
\)
|
\1
|g"
)
"
# "
PREVMAJOR
=
"
$(
major
$PREV
)
"
BMAJOR
=
$(
major
$MAJOR
)
# check first version number
[
"
$(
major
$PREVMAJOR
)
"
=
"
$BMAJOR
"
]
||
fatal
"
$PREVMAJOR
!=
$MAJOR
"
FIRSTSEQ
=
$(
minor
$PREVMAJOR
)
LASTSEQ
=
$(
minor
$MAJOR
)
[
-n
"
$MAJOR
"
]
||
fatal
"MAJOR is empty"
[
-n
"
$PREVMAJOR
"
]
||
fatal
"PREVMAJOR is empty"
wget https://download.seadrive.org/seafile-server_
${
VERSION
}
_x86-64.tar.gz
||
fatal
erc seafile-server_
${
VERSION
}
_x86-64.tar.gz
||
fatal
echo
"Upgrade from
$PREV
to
$VERSION
..."
serv monit stop
/etc/init.d/seafile stop
/etc/init.d/seahub stop
cd
seafile-server-
$VERSION
/upgrade
||
fatal
if
[
"
$FIRSTSEQ
"
!=
"
$LASTSEQ
"
]
;
then
for
i
in
$(
seq
$FIRSTSEQ
$((
$LASTSEQ
-
1
)))
;
do
./upgrade_
${
BMAJOR
}
.
${
i
}
_
${
BMAJOR
}
.
$((
$i
+
1
))
.sh
||
fatal
done
fi
./minor-upgrade.sh
||
fatal
/etc/init.d/seafile start
/etc/init.d/seahub start
serv monit start
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment