forked from Anankke/SSPanel-UIM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate.sh
57 lines (51 loc) · 1.51 KB
/
update.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/bash
cat << "EOF"
SSPanel-UIM update script
Author: M1Screw
Github: https://github.com/sspanel-uim/SSPanel-Uim-Dev
Usage:
./update.sh dev --> Upgrade to the latest development version
./update.sh release release_version db_version --> Upgrade to the specified release version
EOF
[ $(id -u) != "0" ] && { echo "Error: You must be root to run this script!"; exit 1; }
do_update_sspanel_dev(){
git pull
git reset --hard origin/dev
git fetch --prune --prune-tags
rm -r storage/framework/smarty/compile/*
php composer.phar update
php composer.phar selfupdate
php xcat Migration latest
php xcat Update
php xcat Tool importAllSettings
wget https://cdn.jsdelivr.net/gh/sspanel-uim/qqwry.dat@latest/qqwry.dat -O storage/qqwry.dat
}
do_update_sspanel_release(){
tag=$1
db_version=$2
git pull
git reset --hard $tag
rm -r storage/framework/smarty/compile/*
php composer.phar update
php composer.phar selfupdate
php xcat Migration $db_version
php xcat Update
php xcat Tool importAllSettings
wget https://cdn.jsdelivr.net/gh/sspanel-uim/qqwry.dat@latest/qqwry.dat -O storage/qqwry.dat
}
if [[ $1 == "dev" ]]; then
do_update_sspanel_dev
exit 0
fi
if [[ $1 == "release" ]]; then
if [[ $2 == "" ]]; then
echo "Error: The release version cannot be empty!"
exit 1
fi
if [[ $3 == "" ]]; then
echo "Error: The database version cannot be empty!"
exit 1
fi
do_update_sspanel_release $2 $3
exit 0
fi