Fix upgrade script

This commit is contained in:
Josué Tille 2017-09-30 17:52:42 +02:00
parent 79fb212189
commit 7eaf3a540d
5 changed files with 18 additions and 11 deletions

View file

@ -4,7 +4,7 @@ set timeout 5
set seafile_dir [lindex $argv 0] set seafile_dir [lindex $argv 0]
set mysql_password [lindex $argv 1] set mysql_password [lindex $argv 1]
spawn $seafile_dir/upgrade/upgrade_5.1_6.0.sh spawn $seafile_dir/upgrade/upgrade_6.0_6.1.sh
expect "to contiune" expect "to contiune"
send "\r"; send "\r";

View file

@ -4,7 +4,7 @@ set timeout 5
set seafile_dir [lindex $argv 0] set seafile_dir [lindex $argv 0]
set mysql_password [lindex $argv 1] set mysql_password [lindex $argv 1]
spawn $seafile_dir/upgrade/upgrade_6.0_6.1.sh spawn $seafile_dir/upgrade/upgrade_6.1_6.2.sh
expect "to contiune" expect "to contiune"
send "\r"; send "\r";

View file

@ -46,6 +46,15 @@ get_configuration() {
fi fi
} }
set_path_2() {
if [[ $path == '/' ]]
then
path2=$path
else
path2=$path'/'
fi
}
config_nginx() { config_nginx() {
@ -54,7 +63,7 @@ config_nginx() {
if [[ -z $seahub_port ]] || [[ -z $fileserver_port ]] if [[ -z $seahub_port ]] || [[ -z $fileserver_port ]]
then then
seahub_port=$(head -n 20 /etc/nginx/conf.d/$domain.d/seafile.conf | grep -E "fastcgi_pass.*127.0.0.1:" | cut -d':' -f2 | cut -d';' -f1) seahub_port=$(head -n 20 /etc/nginx/conf.d/$domain.d/seafile.conf | grep -E "fastcgi_pass.*127.0.0.1:" | cut -d':' -f2 | cut -d';' -f1)
fileserver_port=$(head -n 20 /etc/nginx/conf.d/$domain.d/seafile.conf | grep -E "proxy_pass.*127.0.0.1:" | cut -d':' -f3 | cut -d';' -f1 | cut -d'/' -f1) fileserver_port=$(head -n 50 /etc/nginx/conf.d/$domain.d/seafile.conf | grep -E "proxy_pass.*127.0.0.1:" | cut -d':' -f3 | cut -d';' -f1 | cut -d'/' -f1)
ynh_app_setting_set $app seahub_port $seahub_port ynh_app_setting_set $app seahub_port $seahub_port
ynh_app_setting_set $app fileserver_port $fileserver_port ynh_app_setting_set $app fileserver_port $fileserver_port

View file

@ -24,6 +24,9 @@ seafile_user=www-data
test $(ynh_webpath_available $domain $path) == 'True' || ynh_die "$domain$path is not available, please use an other domain or path." test $(ynh_webpath_available $domain $path) == 'True' || ynh_die "$domain$path is not available, please use an other domain or path."
ynh_webpath_register $app $domain $path ynh_webpath_register $app $domain $path
# Create special path with / at the end
set_path_2
# Check Final Path availability # Check Final Path availability
test ! -e "$final_path" || ynh_die "This path already contains a folder" test ! -e "$final_path" || ynh_die "This path already contains a folder"
@ -43,14 +46,6 @@ ynh_app_setting_set $app webdav_port $webdav_port
ynh_app_setting_set $app is_public $is_public ynh_app_setting_set $app is_public $is_public
ynh_app_setting_set $app installed_version $seafile_version ynh_app_setting_set $app installed_version $seafile_version
# Create special path with / at the end
if [[ $path == '/' ]]
then
path2=$path
else
path2=$path'/'
fi
# Download new version from sources # Download new version from sources
get_source $architecture $seafile_version get_source $architecture $seafile_version

View file

@ -24,6 +24,9 @@ root_pwd=$(cat /etc/yunohost/mysql)
# Get configuration for user and final path # Get configuration for user and final path
get_configuration get_configuration
# Create special path with / at the end
set_path_2
# Download new version from sources # Download new version from sources
get_source $architecture $seafile_version get_source $architecture $seafile_version