mirror of
https://github.com/YunoHost-Apps/simple-torrent_ynh.git
synced 2024-09-03 20:26:18 +02:00
FIx
This commit is contained in:
parent
a19d3e8566
commit
98128ad54d
3 changed files with 40 additions and 0 deletions
|
@ -0,0 +1,22 @@
|
||||||
|
version = "1.0"
|
||||||
|
|
||||||
|
[main]
|
||||||
|
name = "Simple Torrent configuration"
|
||||||
|
services = ["__APP__"]
|
||||||
|
|
||||||
|
[main.config]
|
||||||
|
name = "Configuration Options"
|
||||||
|
|
||||||
|
[main.config.download_directory]
|
||||||
|
ask = "Set download directory"
|
||||||
|
type = "string"
|
||||||
|
default = "/home/yunohost.app/__APP__/downloads"
|
||||||
|
help = "The directory where downloaded file saves."
|
||||||
|
bind = "DownloadDirectory:__FINALPATH__/config.yml"
|
||||||
|
|
||||||
|
[main.config.watch_directory]
|
||||||
|
ask = "Set watch directory"
|
||||||
|
type = "string"
|
||||||
|
default = "/home/yunohost.app/__APP__/torrents"
|
||||||
|
help = "The directory where downloaded file saves."
|
||||||
|
bind = "WatchDirectory:__FINALPATH__/config.yml"
|
|
@ -27,6 +27,9 @@ architecture=$YNH_ARCH
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
|
download_directory="/home/yunohost.app/$app/downloads"
|
||||||
|
watch_directory="/home/yunohost.app/$app/torrents"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
|
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -51,6 +54,8 @@ ynh_script_progression --message="Storing installation settings..." --weight=2
|
||||||
|
|
||||||
ynh_app_setting_set --app=$app --key=domain --value=$domain
|
ynh_app_setting_set --app=$app --key=domain --value=$domain
|
||||||
ynh_app_setting_set --app=$app --key=path --value=$path_url
|
ynh_app_setting_set --app=$app --key=path --value=$path_url
|
||||||
|
ynh_app_setting_set --app=$app --key=download_directory --value=$download_directory
|
||||||
|
ynh_app_setting_set --app=$app --key=watch_directory --value=$watch_directory
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD MODIFICATIONS
|
# STANDARD MODIFICATIONS
|
||||||
|
|
|
@ -23,6 +23,9 @@ port=$(ynh_app_setting_get --app=$app --key=port)
|
||||||
peer_port=$(ynh_app_setting_get --app=$app --key=peer_port)
|
peer_port=$(ynh_app_setting_get --app=$app --key=peer_port)
|
||||||
architecture=$YNH_ARCH
|
architecture=$YNH_ARCH
|
||||||
|
|
||||||
|
download_directory=$(ynh_app_setting_get --app=$app --key=download_directory)
|
||||||
|
watch_directory=$(ynh_app_setting_get --app=$app --key=watch_directory)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK VERSION
|
# CHECK VERSION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -54,6 +57,16 @@ then
|
||||||
ynh_die --message="Sorry, this app cannot be installed on a 32-bit ARM machine."
|
ynh_die --message="Sorry, this app cannot be installed on a 32-bit ARM machine."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -z "$download_directory" ]; then
|
||||||
|
download_directory="/home/yunohost.app/$app/downloads"
|
||||||
|
ynh_app_setting_set --app=$app --key=download_directory --value=$download_directory
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$watch_directory" ]; then
|
||||||
|
watch_directory="/home/yunohost.app/$app/torrents"
|
||||||
|
ynh_app_setting_set --app=$app --key=watch_directory --value=$watch_directory
|
||||||
|
fi
|
||||||
|
|
||||||
# Cleaning legacy permissions
|
# Cleaning legacy permissions
|
||||||
if ynh_legacy_permissions_exists; then
|
if ynh_legacy_permissions_exists; then
|
||||||
ynh_legacy_permissions_delete_all
|
ynh_legacy_permissions_delete_all
|
||||||
|
|
Loading…
Add table
Reference in a new issue