1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/minetest_ynh.git synced 2024-09-03 20:36:00 +02:00

fixing home_path

This commit is contained in:
Kay0u 2019-10-25 08:55:03 +09:00
parent bbae6dbffd
commit 5d6bc92840
No known key found for this signature in database
GPG key ID: 7FF262C033518333
6 changed files with 21 additions and 15 deletions

View file

@ -29,6 +29,7 @@ ynh_print_info --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
home_path=$(ynh_app_setting_get --app=$app --key=home_path)
domain=$(ynh_app_setting_get --app=$app --key=domain)
#=================================================
@ -55,7 +56,7 @@ ynh_backup --src_path="$final_path"
#=================================================
ynh_print_info --message="Backing up Minetest data..."
ynh_backup --src_path="/home/yunohost.app/$app"
ynh_backup --src_path="$home_path"
#=================================================
# SPECIFIC BACKUP

View file

@ -26,6 +26,7 @@ ynh_print_info --message="Loading installation settings..."
# Needed for helper "ynh_add_nginx_config"
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
home_path=$(ynh_app_setting_get --app=$app --key=home_path)
# Add settings here as needed by your application
#db_name=$(ynh_app_setting_get --app=$app --key=db_name)
@ -51,7 +52,7 @@ change_path=0
#=================================================
ynh_print_info --message="Stop Minetest..."
ynh_systemd_action --action=restart
ynh_replace_string --match_string="$old_domain" --replace_string="$new_domain" --target_file="/home/yunohost.app/$app/.minetest/minetest.conf"
ynh_replace_string --match_string="$old_domain" --replace_string="$new_domain" --target_file="$home_path/.minetest/minetest.conf"
#=================================================
# GENERIC FINALISATION

View file

@ -121,23 +121,25 @@ ynh_setup_source --dest_dir="$final_path"
#=================================================
ynh_print_info --message="Configuring system user..."
# Create a system user
ynh_system_user_create --username=$app --home_dir=/home/yunohost.app/$app --use_shell
home_path=/home/yunohost.app/$app
ynh_app_setting_set --app=$app --key=home_path --value=$home_path
# Create a system user
ynh_system_user_create --username=$app --home_dir=$home_path --use_shell
#=================================================
# COPY CONFIG FILE
#=================================================
if [ -e /home/yunohost.app/$app ]
if [ -e $home_path ]
then
echo "Nothing to do..."
else
mkdir -p /home/yunohost.app/$app/.minetest/
mkdir /home/yunohost.app/$app/.minetest/worlds/
mkdir -p $home_path/.minetest/
mkdir $home_path/.minetest/worlds/
fi
cp -a ../conf/minetest.conf /home/yunohost.app/$app/.minetest/
cp -a ../conf/minetest.conf $home_path/.minetest/
#=================================================
# SETUP SYSTEMD

View file

@ -19,6 +19,7 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain)
port=$(ynh_app_setting_get --app=$app --key=port)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
home_path=$(ynh_app_setting_get --app=$app --key=home_path)
#=================================================
# STANDARD REMOVE
@ -56,7 +57,7 @@ ynh_print_info --message="Removing app main directory"
# Remove the app directory securely
ynh_secure_remove --file="$final_path"
ynh_secure_remove --file="/home/yunohost.app/$app"
ynh_secure_remove --file="$home_path"
#=================================================
# REMOVE LOGROTATE CONFIGURATION

View file

@ -31,6 +31,7 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
home_path=$(ynh_app_setting_get --app=$app --key=home_path)
#=================================================
# CHECK IF THE APP CAN BE RESTORED
@ -58,7 +59,7 @@ ynh_restore_file --origin_path="$final_path"
ynh_print_info --message="Recreating the dedicated system user..."
# Create the dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir=/home/yunohost.app/$app --use_shell
ynh_system_user_create --username=$app --home_dir=$home_path --use_shell
# Restore home_path
ynh_restore_file --origin_path="$home_path"
@ -69,7 +70,7 @@ ynh_restore_file --origin_path="$home_path"
# Restore permissions on app files
chown -R root: $final_path
chown -R $app: /home/yunohost.app/$app
chown -R $app: $home_path
#=================================================
# SPECIFIC RESTORATION

View file

@ -97,7 +97,7 @@ ynh_install_app_dependencies $pkg_dependencies
ynh_print_info --message="Making sure dedicated system user exists..."
# Create a dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir=/home/yunohost.app/$app --use_shell
ynh_system_user_create --username=$app --home_dir=$home_path --use_shell
#=================================================
# SETUP SYSTEMD
@ -111,12 +111,12 @@ ynh_add_systemd_config
# COPY CONFIG FILE
#=================================================
if [ -e /home/yunohost.app/$app ]
if [ -e $home_path ]
then
echo "Nothing to do..."
else
mkdir -p /home/yunohost.app/$app/.minetest/
mkdir /home/yunohost.app/$app/.minetest/worlds/
mkdir -p $home_path/.minetest/
mkdir $home_path/.minetest/worlds/
fi
#=================================================