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

refactor: remove old ynh_normalize_url_path

better description

remove ask for mandatory app install args

needs_exposed_ports 547 67 for service

add recommended User=root in service unit file
This commit is contained in:
HugoPoi 2021-03-17 23:42:24 +01:00
parent 94d94648de
commit bf890a9e27
6 changed files with 8 additions and 23 deletions

View file

@ -1,10 +1,11 @@
[Unit]
Description=YunoHost Wifi Hotspot.
Description=YunoHost Wifi Hotspot
Requires=network.target
After=network.target
[Service]
Type=oneshot
User=root
ExecStart=/usr/local/bin/ynh-hotspot start
ExecStop=/usr/local/bin/ynh-hotspot stop
RemainAfterExit=yes

View file

@ -3,8 +3,8 @@
"id": "hotspot",
"packaging_format": 1,
"description": {
"en": "Wifi Hotspot",
"fr": "Hotspot Wifi"
"en": "Create and manager wifi networks, share Internet access and use Yunohost apps accross wifi",
"fr": "Créer et configurer des réseaux wifi, partager l'accès a Internet et utiliser les applications Yunohost via wifi"
},
"url": "https://github.com/labriqueinternet/hotspot_ynh",
"version": "1.2.0~ynh3",
@ -27,20 +27,11 @@
{
"name": "domain",
"type": "domain",
"ask": {
"en": "Choose a domain for the web administration",
"fr": "Choisissez un domaine pour l'administration web"
},
"example": "domain.org"
},
{
"name": "path",
"type": "path",
"ask": {
"en": "Choose a path for the web administration",
"fr": "Choisissez un chemin pour l'administration web"
},
"example": "/wifiadmin",
"default": "/wifiadmin"
},
{

View file

@ -20,7 +20,7 @@ function check_armbian_nonfree_conflict()
if dpkg --list | grep -q armbian-firmware; then
echo "You are running Armbian and firmware-misc-nonfree are known to conflict with armbian-firwmare. " >&2
echo "The package firmware-misc-nonfree is a dependency of firmware-ralink, so firmware-ralink will NOT be installed" >&2
echo "You can manually install firmware-ralink with 'sudo apt -o Dpkg::Options::=\"--force-overwrite\" firmware-ralink'" >&2
echo "You can manually install firmware-ralink with 'apt -o Dpkg::Options::=\"--force-overwrite\" firmware-ralink'" >&2
nonfree_firmware_packages=$(echo $nonfree_firmware_packages | sed 's/ firmware-ralink//')
fi

View file

@ -290,7 +290,7 @@ fi
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..."
yunohost service add $service_name --description "Creates a Wi-Fi access point" --test_status "systemctl is-active hostapd"
yunohost service add $service_name --description "Creates a Wi-Fi access point" --test_status "systemctl is-active hostapd" --needs_exposed_ports 547 67
#=================================================
# START SYSTEMD SERVICE

View file

@ -133,7 +133,7 @@ systemctl enable $service_name.service --quiet
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..."
yunohost service add $service_name --description "Creates a Wi-Fi access point" --test_status "systemctl is-active hostapd"
yunohost service add $service_name --description "Creates a Wi-Fi access point" --test_status "systemctl is-active hostapd" --needs_exposed_ports 547 67
#=================================================
# START SYSTEMD SERVICE

View file

@ -80,13 +80,6 @@ ynh_clean_setup () {
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# CHECK THE PATH
#=================================================
# Normalize the URL path syntax
path_url=$(ynh_normalize_url_path --path_url=$path_url)
#=================================================
# STANDARD UPGRADE STEPS
#=================================================
@ -199,7 +192,7 @@ find ${final_path}/ -type d -exec chmod +x {} \;
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..."
yunohost service add $service_name --description "Creates a Wi-Fi access point" --test_status "systemctl is-active hostapd"
yunohost service add $service_name --description "Creates a Wi-Fi access point" --test_status "systemctl is-active hostapd" --needs_exposed_ports 547 67
#=================================================
# START SYSTEMD SERVICE