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:
parent
bbae6dbffd
commit
5d6bc92840
6 changed files with 21 additions and 15 deletions
|
@ -29,6 +29,7 @@ ynh_print_info --message="Loading installation settings..."
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
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)
|
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_print_info --message="Backing up Minetest data..."
|
||||||
|
|
||||||
ynh_backup --src_path="/home/yunohost.app/$app"
|
ynh_backup --src_path="$home_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC BACKUP
|
# SPECIFIC BACKUP
|
||||||
|
|
|
@ -26,6 +26,7 @@ ynh_print_info --message="Loading installation settings..."
|
||||||
|
|
||||||
# Needed for helper "ynh_add_nginx_config"
|
# Needed for helper "ynh_add_nginx_config"
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
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
|
# Add settings here as needed by your application
|
||||||
#db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
#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_print_info --message="Stop Minetest..."
|
||||||
ynh_systemd_action --action=restart
|
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
|
# GENERIC FINALISATION
|
||||||
|
|
|
@ -121,23 +121,25 @@ ynh_setup_source --dest_dir="$final_path"
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info --message="Configuring system user..."
|
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
|
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
|
# COPY CONFIG FILE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
if [ -e /home/yunohost.app/$app ]
|
if [ -e $home_path ]
|
||||||
then
|
then
|
||||||
echo "Nothing to do..."
|
echo "Nothing to do..."
|
||||||
else
|
else
|
||||||
mkdir -p /home/yunohost.app/$app/.minetest/
|
mkdir -p $home_path/.minetest/
|
||||||
mkdir /home/yunohost.app/$app/.minetest/worlds/
|
mkdir $home_path/.minetest/worlds/
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cp -a ../conf/minetest.conf /home/yunohost.app/$app/.minetest/
|
cp -a ../conf/minetest.conf $home_path/.minetest/
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SYSTEMD
|
# SETUP SYSTEMD
|
||||||
|
|
|
@ -19,6 +19,7 @@ app=$YNH_APP_INSTANCE_NAME
|
||||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||||
port=$(ynh_app_setting_get --app=$app --key=port)
|
port=$(ynh_app_setting_get --app=$app --key=port)
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
|
home_path=$(ynh_app_setting_get --app=$app --key=home_path)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD REMOVE
|
# STANDARD REMOVE
|
||||||
|
@ -56,7 +57,7 @@ ynh_print_info --message="Removing app main directory"
|
||||||
|
|
||||||
# Remove the app directory securely
|
# Remove the app directory securely
|
||||||
ynh_secure_remove --file="$final_path"
|
ynh_secure_remove --file="$final_path"
|
||||||
ynh_secure_remove --file="/home/yunohost.app/$app"
|
ynh_secure_remove --file="$home_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE LOGROTATE CONFIGURATION
|
# REMOVE LOGROTATE CONFIGURATION
|
||||||
|
|
|
@ -31,6 +31,7 @@ app=$YNH_APP_INSTANCE_NAME
|
||||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||||
path_url=$(ynh_app_setting_get --app=$app --key=path)
|
path_url=$(ynh_app_setting_get --app=$app --key=path)
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_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
|
# 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..."
|
ynh_print_info --message="Recreating the dedicated system user..."
|
||||||
|
|
||||||
# Create the dedicated user (if not existing)
|
# 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
|
# Restore home_path
|
||||||
ynh_restore_file --origin_path="$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
|
# Restore permissions on app files
|
||||||
chown -R root: $final_path
|
chown -R root: $final_path
|
||||||
chown -R $app: /home/yunohost.app/$app
|
chown -R $app: $home_path
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC RESTORATION
|
# SPECIFIC RESTORATION
|
||||||
|
|
|
@ -97,7 +97,7 @@ ynh_install_app_dependencies $pkg_dependencies
|
||||||
ynh_print_info --message="Making sure dedicated system user exists..."
|
ynh_print_info --message="Making sure dedicated system user exists..."
|
||||||
|
|
||||||
# Create a dedicated user (if not existing)
|
# 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
|
# SETUP SYSTEMD
|
||||||
|
@ -111,12 +111,12 @@ ynh_add_systemd_config
|
||||||
# COPY CONFIG FILE
|
# COPY CONFIG FILE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
if [ -e /home/yunohost.app/$app ]
|
if [ -e $home_path ]
|
||||||
then
|
then
|
||||||
echo "Nothing to do..."
|
echo "Nothing to do..."
|
||||||
else
|
else
|
||||||
mkdir -p /home/yunohost.app/$app/.minetest/
|
mkdir -p $home_path/.minetest/
|
||||||
mkdir /home/yunohost.app/$app/.minetest/worlds/
|
mkdir $home_path/.minetest/worlds/
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Reference in a new issue