mirror of
https://github.com/YunoHost-Apps/mopidy_ynh.git
synced 2024-09-03 19:46:21 +02:00
set progression bar
This commit is contained in:
parent
02977a75fd
commit
1ccd5ba821
1 changed files with 17 additions and 17 deletions
|
@ -36,7 +36,7 @@ cmd_file="/usr/local/bin/mopidyctl"
|
|||
#=================================================
|
||||
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
|
||||
#=================================================
|
||||
ynh_script_progression --message="Validating installation parameters..." --time --weight=1
|
||||
ynh_script_progression --message="Validating installation parameters..."
|
||||
|
||||
test ! -e "$final_path" || ynh_die --message="This path already contains a folder"
|
||||
|
||||
|
@ -56,7 +56,7 @@ ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url
|
|||
#=================================================
|
||||
# STORE SETTINGS FROM MANIFEST
|
||||
#=================================================
|
||||
ynh_script_progression --message="Storing installation settings..." --time --weight=1
|
||||
ynh_script_progression --message="Storing installation settings..."
|
||||
|
||||
ynh_app_setting_set --app=$app --key=domain --value=$domain
|
||||
ynh_app_setting_set --app=$app --key=path --value=$path_url
|
||||
|
@ -66,7 +66,7 @@ ynh_app_setting_set --app=$app --key=path --value=$path_url
|
|||
#=================================================
|
||||
# FIND AND OPEN A PORT
|
||||
#=================================================
|
||||
ynh_script_progression --message="Finding an available port..." --time --weight=1
|
||||
ynh_script_progression --message="Finding an available port..."
|
||||
|
||||
# Find an available port
|
||||
port=$(ynh_find_port --port=6680)
|
||||
|
@ -75,14 +75,14 @@ ynh_app_setting_set --app=$app --key=port --value=$port
|
|||
#=================================================
|
||||
# INSTALL DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Installing dependencies..." --time --weight=1
|
||||
ynh_script_progression --message="Installing dependencies..." --weight=40
|
||||
|
||||
ynh_install_app_dependencies $pkg_dependencies
|
||||
|
||||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring system user..." --time --weight=1
|
||||
ynh_script_progression --message="Configuring system user..."
|
||||
|
||||
# Create a system user
|
||||
ynh_system_user_create --username="$app" --home_dir="$final_path" --use_shell
|
||||
|
@ -90,7 +90,7 @@ ynh_system_user_create --username="$app" --home_dir="$final_path" --use_shell
|
|||
#=================================================
|
||||
# INSTALL MOPIDY IN PYTHON ENVIRONMENT
|
||||
#=================================================
|
||||
ynh_script_progression --message="Setting up source files..." --time --weight=1
|
||||
ynh_script_progression --message="Install in Python environment..."
|
||||
|
||||
myynh_install
|
||||
|
||||
|
@ -99,7 +99,7 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
|||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring NGINX web server..." --time --weight=1
|
||||
ynh_script_progression --message="Configuring NGINX web server..."
|
||||
|
||||
# Create a dedicated NGINX config
|
||||
ynh_add_nginx_config
|
||||
|
@ -111,7 +111,7 @@ ynh_add_nginx_config
|
|||
#=================================================
|
||||
# CREATE YUNOHOST DIRECTORIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Creating yunohost directories..." --time --weight=1
|
||||
ynh_script_progression --message="Creating yunohost directories..."
|
||||
|
||||
ynh_multimedia_build_main_dir # /home/yunohost.multimedia
|
||||
|
||||
|
@ -122,7 +122,7 @@ chown -R $app: "$work_dir"
|
|||
#=================================================
|
||||
# SETUP SYSTEMD
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring a systemd service..." --time --weight=1
|
||||
ynh_script_progression --message="Configuring a systemd service..."
|
||||
|
||||
# Create a dedicated systemd config
|
||||
start_file="$final_path/env/bin/$app"
|
||||
|
@ -131,7 +131,7 @@ ynh_add_systemd_config --others_var="conf_file start_file" # substitute __CO
|
|||
#=================================================
|
||||
# MODIFY A CONFIG FILE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Setup config file..." --time --weight=1
|
||||
ynh_script_progression --message="Setup config file..."
|
||||
|
||||
cp ../conf/app.conf "$conf_file"
|
||||
if [ -n "$(uname -m | grep arm)" ]; # check CPU (raspberry is armxx)
|
||||
|
@ -163,14 +163,14 @@ chown $app: $final_path
|
|||
#=================================================
|
||||
# INTEGRATE SERVICE IN YUNOHOST
|
||||
#=================================================
|
||||
ynh_script_progression --message="Integrating service in YunoHost..." --time --weight=1
|
||||
ynh_script_progression --message="Integrating service in YunoHost..."
|
||||
|
||||
yunohost service add $app --log_type systemd --description "this is mopidy, a music server"
|
||||
|
||||
#=================================================
|
||||
# START SYSTEMD SERVICE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Starting a systemd service..." --time --weight=1
|
||||
ynh_script_progression --message="Starting a systemd service..."
|
||||
|
||||
# Start a systemd service
|
||||
ynh_systemd_action --service_name=$app --action="start"
|
||||
|
@ -178,7 +178,7 @@ ynh_systemd_action --service_name=$app --action="start"
|
|||
#=================================================
|
||||
# SETUP SSOWAT
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring permissions..." --time --weight=1
|
||||
ynh_script_progression --message="Configuring permissions..."
|
||||
|
||||
# Make app public if necessary
|
||||
if [ $is_public -eq 1 ]; then
|
||||
|
@ -192,14 +192,14 @@ ynh_permission_url --permission="main" --add_url="$domain/musicbox_webclient"
|
|||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
|
||||
ynh_script_progression --message="Reloading NGINX web server..."
|
||||
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
|
||||
#=================================================
|
||||
# PROVIDE ADDITIONAL SHELL COMAND
|
||||
#=================================================
|
||||
ynh_script_progression --message="Provide additional shell comand..." --time --weight=1
|
||||
ynh_script_progression --message="Provide additional shell comand..."
|
||||
|
||||
cp -a ../sources/extra_files/mopidyctl "$cmd_file"
|
||||
ynh_replace_string --match_string="__APP__" --replace_string=$app --target_file="$cmd_file"
|
||||
|
@ -228,7 +228,7 @@ fi
|
|||
#=================================================
|
||||
# SCAN LOCAL MEDIA DIRECTORY
|
||||
#=================================================
|
||||
ynh_script_progression --message="Scan local media directory..." --weight=1
|
||||
ynh_script_progression --message="Scan local media directory..."
|
||||
|
||||
"$cmd_file" local scan
|
||||
|
||||
|
@ -236,4 +236,4 @@ ynh_script_progression --message="Scan local media directory..." --weight=1
|
|||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Installation of $app completed" --time --last
|
||||
ynh_script_progression --message="Installation of $app completed"--last
|
||||
|
|
Loading…
Add table
Reference in a new issue