1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/tvheadend_ynh.git synced 2024-10-01 13:34:50 +02:00

Use debconf-set-selections for superuser config file

This commit is contained in:
Sylvain CECCHETTO 2021-10-08 12:53:49 +02:00
parent 52191a40f2
commit 52494315f2
4 changed files with 10 additions and 16 deletions

View file

@ -1,4 +0,0 @@
{
"username": "__SUPERUSER__",
"password": "__PASSWORD__"
}

View file

@ -100,6 +100,11 @@ ynh_exec_quiet "wget -q -O $tvheadend_deb_dst $tvheadend_deb_url"
#=================================================
ynh_script_progression --message="Installing Tvheadend..." --weight=24
# Pre-seed debconf database with answers of the interactive dpkg
echo tvheadend tvheadend/admin_password password $password | debconf-set-selections
echo tvheadend tvheadend/admin_username string $superuser | debconf-set-selections
echo tvheadend tvheadend/last_notes note | debconf-set-selections
ynh_exec_warn_less DEBIAN_FRONTEND=noninteractive dpkg -i $tvheadend_deb_dst
ynh_secure_remove --file="$temp_folder"
@ -125,12 +130,6 @@ else
ynh_add_config --template="tvheadend" --destination="/etc/default/tvheadend"
fi
# Copy and modify /home/hts/.hts/tvheadend/superuser
ynh_add_config --template="superuser" --destination="${conf_dir}/superuser"
chown hts:video "${conf_dir}/superuser"
chmod 600 "${conf_dir}/superuser"
#=================================================
# NGINX CONFIGURATION
#=================================================

View file

@ -91,6 +91,11 @@ ynh_exec_quiet "wget -q -O $tvheadend_deb_dst $tvheadend_deb_url"
#=================================================
ynh_script_progression --message="Installing Tvheadend..." --weight=13
# Pre-seed debconf database with answers of the interactive dpkg
echo tvheadend tvheadend/admin_password password $password | debconf-set-selections
echo tvheadend tvheadend/admin_username string $superuser | debconf-set-selections
echo tvheadend tvheadend/last_notes note | debconf-set-selections
ynh_exec_warn_less DEBIAN_FRONTEND=noninteractive dpkg -i $tvheadend_deb_dst
ynh_secure_remove --file="$temp_folder"

View file

@ -114,12 +114,6 @@ then
else
ynh_add_config --template="tvheadend" --destination="/etc/default/tvheadend"
fi
# Copy and modify /home/hts/.hts/tvheadend/superuser
ynh_add_config --template="superuser" --destination="${conf_dir}/superuser"
chown hts:video "${conf_dir}/superuser"
chmod 600 "${conf_dir}/superuser"
fi