1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/hotspot_ynh.git synced 2024-09-03 19:25:53 +02:00

Cleanup the whole stuff with .tpl file ... we don't need to copy them to intermediate locations, nor to backup/restore them...

This commit is contained in:
Alexandre Aubin 2023-10-05 19:00:56 +02:00
parent 3a72871641
commit b80ee8b347
8 changed files with 3 additions and 23 deletions

View file

@ -80,14 +80,14 @@ function configure_hostapd()
sec_comment="#"
fi
ynh_add_config --template="/etc/hostapd/$app/hostapd.conf.tpl" --destination="/etc/hostapd/$app/hostapd.conf"
ynh_add_config --template="../conf/hostapd.conf" --destination="/etc/hostapd/$app/hostapd.conf"
}
function configure_dhcp()
{
ynh_add_config --template="/etc/dnsmasq.$app/dhcpdv4.conf.tpl" --destination="/etc/dnsmasq.$app/dhcpdv4.conf"
ynh_add_config --template="../conf/dhcpdv4.conf" --destination="/etc/dnsmasq.$app/dhcpdv4.conf"
if [[ -n "${ip6_net}" ]] && [[ "${ip6_net}" != "none" ]]; then
ynh_add_config --template="/etc/dnsmasq.$app/dhcpdv6.conf.tpl" --destination="/etc/dnsmasq.$app/dhcpdv6.conf"
ynh_add_config --template="../conf/dhcpdv6.conf" --destination="/etc/dnsmasq.$app/dhcpdv6.conf"
fi
}

View file

@ -40,15 +40,8 @@ ynh_print_info --message="Declaring files to be backed up..."
# BACKUP THE APP MAIN DIR
#=================================================
ynh_backup --src_path="/etc/hostapd/$app/hostapd.conf.tpl"
ynh_backup --src_path="/etc/hostapd/$app/hostapd.conf" --not_mandatory
ynh_backup --src_path="/etc/dnsmasq.d/$app.conf" --not_mandatory
ynh_backup --src_path="/etc/dnsmasq.$app/dhcpdv6.conf.tpl"
ynh_backup --src_path="/etc/dnsmasq.$app/dhcpdv6.conf" --not_mandatory
ynh_backup --src_path="/etc/dnsmasq.$app/dhcpdv4.conf.tpl"
ynh_backup --src_path="/etc/dnsmasq.$app/dhcpdv4.conf" --not_mandatory
ynh_backup --src_path="/usr/local/bin/$service_name"

View file

@ -161,10 +161,6 @@ chown root: /etc/hostapd/$app/
mkdir -pm 0755 /etc/dnsmasq.$app/
chown root: /etc/dnsmasq.$app/
install -b -o root -g root -m 0644 ../conf/hostapd.conf.tpl /etc/hostapd/$app/hostapd.conf.tpl
install -b -o root -g root -m 0644 ../conf/dnsmasq_dhcpdv6.conf.tpl /etc/dnsmasq.$app/dhcpdv6.conf.tpl
install -b -o root -g root -m 0644 ../conf/dnsmasq_dhcpdv4.conf.tpl /etc/dnsmasq.$app/dhcpdv4.conf.tpl
# Copy init script
ynh_add_config --template="../conf/ynh-hotspot" --destination="/usr/local/bin/$service_name"
chmod 0755 "/usr/local/bin/$service_name"

View file

@ -71,13 +71,8 @@ else
pkg_dependencies="$pkg_dependencies $free_firmware_packages"
fi
ynh_restore_file --origin_path="/etc/hostapd/$app/hostapd.conf.tpl"
ynh_restore_file --origin_path="/etc/hostapd/$app/hostapd.conf" --not_mandatory
ynh_restore_file --origin_path="/etc/dnsmasq.$app/dhcpdv6.conf.tpl"
ynh_restore_file --origin_path="/etc/dnsmasq.$app/dhcpdv6.conf" --not_mandatory
ynh_restore_file --origin_path="/etc/dnsmasq.$app/dhcpdv4.conf.tpl"
ynh_restore_file --origin_path="/etc/dnsmasq.$app/dhcpdv4.conf" --not_mandatory
ynh_restore_file --origin_path="/usr/local/bin/$service_name"

View file

@ -213,10 +213,6 @@ chown root: /etc/hostapd/$app/
mkdir -pm 0755 /etc/dnsmasq.$app/
chown root: /etc/dnsmasq.$app/
install -b -o root -g root -m 0644 ../conf/hostapd.conf.tpl /etc/hostapd/$app/hostapd.conf.tpl
install -b -o root -g root -m 0644 ../conf/dnsmasq_dhcpdv6.conf.tpl /etc/dnsmasq.$app/dhcpdv6.conf.tpl
install -b -o root -g root -m 0644 ../conf/dnsmasq_dhcpdv4.conf.tpl /etc/dnsmasq.$app/dhcpdv4.conf.tpl
if [[ -n "${wifi_device}" ]]; then
configure_hostapd
configure_dhcp