mirror of
https://github.com/YunoHost-Apps/hotspot_ynh.git
synced 2024-09-03 19:25:53 +02:00
Various fixes @_@
This commit is contained in:
parent
e2d7a00861
commit
eef16c74c4
3 changed files with 40 additions and 37 deletions
|
@ -6,19 +6,24 @@ name = "Configuration"
|
||||||
[main.service]
|
[main.service]
|
||||||
name = ""
|
name = ""
|
||||||
optional = false
|
optional = false
|
||||||
|
|
||||||
[main.service.no_antenna]
|
[main.service.no_antenna]
|
||||||
|
# The value is filled via a custom getter
|
||||||
|
type = "boolean"
|
||||||
|
visible = "false"
|
||||||
|
|
||||||
|
[main.service.no_antenna_alert]
|
||||||
ask = "No wifi antenna has been detected! If you use a wifi USB dongle and that this one is not listed here, try to unplug and replug it, then reload this page."
|
ask = "No wifi antenna has been detected! If you use a wifi USB dongle and that this one is not listed here, try to unplug and replug it, then reload this page."
|
||||||
type = "alert"
|
type = "alert"
|
||||||
style = "danger"
|
style = "danger"
|
||||||
visible = "no_antenna"
|
visible = "no_antenna"
|
||||||
|
|
||||||
[main.service.status]
|
[main.service.status]
|
||||||
ask = "The status of your VPN is unknown."
|
ask = "The status of your VPN is unknown."
|
||||||
type = "alert"
|
type = "alert"
|
||||||
style = "info"
|
style = "info"
|
||||||
visible = "! no_antenna"
|
visible = "! no_antenna"
|
||||||
|
|
||||||
[main.service.service_enabled]
|
[main.service.service_enabled]
|
||||||
ask = "Enable Hotspot"
|
ask = "Enable Hotspot"
|
||||||
type = "boolean"
|
type = "boolean"
|
||||||
|
@ -29,7 +34,7 @@ name = "Configuration"
|
||||||
type = "select"
|
type = "select"
|
||||||
choices.wlan0 = "wlan0"
|
choices.wlan0 = "wlan0"
|
||||||
visible = "! no_antenna"
|
visible = "! no_antenna"
|
||||||
|
|
||||||
[main.service.wifi_channel]
|
[main.service.wifi_channel]
|
||||||
ask = "Channel"
|
ask = "Channel"
|
||||||
type = "select"
|
type = "select"
|
||||||
|
@ -46,7 +51,7 @@ name = "Configuration"
|
||||||
choices.11 = "11"
|
choices.11 = "11"
|
||||||
visible = "! no_antenna"
|
visible = "! no_antenna"
|
||||||
help = "Changing the channel may help with signal strength depending on neighbour WiFis"
|
help = "Changing the channel may help with signal strength depending on neighbour WiFis"
|
||||||
|
|
||||||
[main.service.multissid]
|
[main.service.multissid]
|
||||||
ask = "Number of hotspots to broadcast"
|
ask = "Number of hotspots to broadcast"
|
||||||
type = "select"
|
type = "select"
|
||||||
|
@ -54,7 +59,7 @@ name = "Configuration"
|
||||||
choices.2 = "2"
|
choices.2 = "2"
|
||||||
choices.3 = "3"
|
choices.3 = "3"
|
||||||
visible = "! no_antenna"
|
visible = "! no_antenna"
|
||||||
|
|
||||||
[main.hotspot1]
|
[main.hotspot1]
|
||||||
name = "Hotspot 1"
|
name = "Hotspot 1"
|
||||||
optional = false
|
optional = false
|
||||||
|
@ -66,7 +71,7 @@ name = "Configuration"
|
||||||
bind = "array_settings()"
|
bind = "array_settings()"
|
||||||
pattern.regexp = '^[\w \-]{1,32}$'
|
pattern.regexp = '^[\w \-]{1,32}$'
|
||||||
pattern.error = "SSID in this app are limited to letter, number space, dash and underscores."
|
pattern.error = "SSID in this app are limited to letter, number space, dash and underscores."
|
||||||
|
|
||||||
[main.hotspot1.wifi_secure__1]
|
[main.hotspot1.wifi_secure__1]
|
||||||
ask = "Secure"
|
ask = "Secure"
|
||||||
type = "boolean"
|
type = "boolean"
|
||||||
|
@ -78,15 +83,15 @@ name = "Configuration"
|
||||||
bind = "array_settings()"
|
bind = "array_settings()"
|
||||||
redact = true
|
redact = true
|
||||||
optional = true
|
optional = true
|
||||||
visible = "wifi_secure__1"
|
visible = "wifi_secure__1"
|
||||||
pattern.regexp = '^[a-zA-Z0-9]{8,63}$'
|
pattern.regexp = '^[a-zA-Z0-9]{8,63}$'
|
||||||
pattern.error = "Only printable alphanumeric characters are permitted in your password. Maximal size 63 chars"
|
pattern.error = "Only printable alphanumeric characters are permitted in your password. Maximal size 63 chars"
|
||||||
|
|
||||||
[main.hotspot1.advanced__1]
|
[main.hotspot1.advanced__1]
|
||||||
ask = "Advanced settings"
|
ask = "Advanced settings"
|
||||||
type = "boolean"
|
type = "boolean"
|
||||||
bind = "array_settings()"
|
bind = "array_settings()"
|
||||||
|
|
||||||
[main.hotspot1.ip4_nat_prefix__1]
|
[main.hotspot1.ip4_nat_prefix__1]
|
||||||
ask = "IPv4 NAT prefix (/24)"
|
ask = "IPv4 NAT prefix (/24)"
|
||||||
type = "string"
|
type = "string"
|
||||||
|
@ -94,7 +99,7 @@ name = "Configuration"
|
||||||
visible = "advanced__1"
|
visible = "advanced__1"
|
||||||
pattern.regexp = '^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$'
|
pattern.regexp = '^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$'
|
||||||
pattern.error = "Please provide a private /24 range in the format xxx.xxx.xxx"
|
pattern.error = "Please provide a private /24 range in the format xxx.xxx.xxx"
|
||||||
|
|
||||||
[main.hotspot1.ip6_net__1]
|
[main.hotspot1.ip6_net__1]
|
||||||
ask = "IPv6 delegated prefix"
|
ask = "IPv6 delegated prefix"
|
||||||
type = "string"
|
type = "string"
|
||||||
|
@ -103,13 +108,13 @@ name = "Configuration"
|
||||||
visible = "advanced__1"
|
visible = "advanced__1"
|
||||||
pattern.regexp = '^[0-9a-fA-F:]+$'
|
pattern.regexp = '^[0-9a-fA-F:]+$'
|
||||||
pattern.error = "Please provide a valid IPv6 Prefix"
|
pattern.error = "Please provide a valid IPv6 Prefix"
|
||||||
|
|
||||||
[main.hotspot1.ip6_firewall__1]
|
[main.hotspot1.ip6_firewall__1]
|
||||||
ask = "IPv6 firewall"
|
ask = "IPv6 firewall"
|
||||||
type = "boolean"
|
type = "boolean"
|
||||||
bind = "array_settings()"
|
bind = "array_settings()"
|
||||||
visible = "advanced__1"
|
visible = "advanced__1"
|
||||||
|
|
||||||
[main.hotspot1.dns__1]
|
[main.hotspot1.dns__1]
|
||||||
ask = "DNS resolvers"
|
ask = "DNS resolvers"
|
||||||
type = "tags"
|
type = "tags"
|
||||||
|
@ -117,7 +122,7 @@ name = "Configuration"
|
||||||
visible = "advanced__1"
|
visible = "advanced__1"
|
||||||
pattern.regexp = '^([0-9.]{7,15}|[0-9a-fA-F:]+)$'
|
pattern.regexp = '^([0-9.]{7,15}|[0-9a-fA-F:]+)$'
|
||||||
pattern.error = "Not an ip"
|
pattern.error = "Not an ip"
|
||||||
|
|
||||||
[main.hotspot2]
|
[main.hotspot2]
|
||||||
name = "Hotspot 2"
|
name = "Hotspot 2"
|
||||||
visible = "! no_antenna && multissid >= 2"
|
visible = "! no_antenna && multissid >= 2"
|
||||||
|
@ -128,7 +133,7 @@ name = "Configuration"
|
||||||
bind = "array_settings()"
|
bind = "array_settings()"
|
||||||
pattern.regexp = '^[\w \-]{1,32}$'
|
pattern.regexp = '^[\w \-]{1,32}$'
|
||||||
pattern.error = "SSID in this app are limited to letter, number space, dash and underscores."
|
pattern.error = "SSID in this app are limited to letter, number space, dash and underscores."
|
||||||
|
|
||||||
[main.hotspot2.wifi_secure__2]
|
[main.hotspot2.wifi_secure__2]
|
||||||
ask = "Secure"
|
ask = "Secure"
|
||||||
type = "boolean"
|
type = "boolean"
|
||||||
|
@ -139,15 +144,15 @@ name = "Configuration"
|
||||||
type = "string"
|
type = "string"
|
||||||
bind = "array_settings()"
|
bind = "array_settings()"
|
||||||
redact = true
|
redact = true
|
||||||
visible = "wifi_secure__2"
|
visible = "wifi_secure__2"
|
||||||
pattern.regexp = '^[a-zA-Z0-9]{8,63}$'
|
pattern.regexp = '^[a-zA-Z0-9]{8,63}$'
|
||||||
pattern.error = "Only printable alphanumeric characters are permitted in your password. Maximal size 63 chars"
|
pattern.error = "Only printable alphanumeric characters are permitted in your password. Maximal size 63 chars"
|
||||||
|
|
||||||
[main.hotspot2.advanced__2]
|
[main.hotspot2.advanced__2]
|
||||||
ask = "Advanced settings"
|
ask = "Advanced settings"
|
||||||
type = "boolean"
|
type = "boolean"
|
||||||
bind = "array_settings()"
|
bind = "array_settings()"
|
||||||
|
|
||||||
[main.hotspot2.ip4_nat_prefix__2]
|
[main.hotspot2.ip4_nat_prefix__2]
|
||||||
ask = "IPv4 NAT prefix (/24)"
|
ask = "IPv4 NAT prefix (/24)"
|
||||||
type = "string"
|
type = "string"
|
||||||
|
@ -155,7 +160,7 @@ name = "Configuration"
|
||||||
visible = "advanced__2"
|
visible = "advanced__2"
|
||||||
pattern.regexp = '^[0-9.]{7,15}$'
|
pattern.regexp = '^[0-9.]{7,15}$'
|
||||||
pattern.error = "Please provide a valid IP"
|
pattern.error = "Please provide a valid IP"
|
||||||
|
|
||||||
[main.hotspot2.ip6_net__2]
|
[main.hotspot2.ip6_net__2]
|
||||||
ask = "IPv6 delegated prefix"
|
ask = "IPv6 delegated prefix"
|
||||||
type = "string"
|
type = "string"
|
||||||
|
@ -163,13 +168,13 @@ name = "Configuration"
|
||||||
visible = "advanced__2"
|
visible = "advanced__2"
|
||||||
pattern.regexp = '^[0-9a-fA-F:]+$'
|
pattern.regexp = '^[0-9a-fA-F:]+$'
|
||||||
pattern.error = "Please provide a valid IPv6 Prefix"
|
pattern.error = "Please provide a valid IPv6 Prefix"
|
||||||
|
|
||||||
[main.hotspot2.ip6_firewall__2]
|
[main.hotspot2.ip6_firewall__2]
|
||||||
ask = "IPv6 firewall"
|
ask = "IPv6 firewall"
|
||||||
type = "boolean"
|
type = "boolean"
|
||||||
bind = "array_settings()"
|
bind = "array_settings()"
|
||||||
visible = "advanced__2"
|
visible = "advanced__2"
|
||||||
|
|
||||||
[main.hotspot2.dns__2]
|
[main.hotspot2.dns__2]
|
||||||
ask = "DNS resolvers"
|
ask = "DNS resolvers"
|
||||||
type = "tags"
|
type = "tags"
|
||||||
|
@ -177,7 +182,7 @@ name = "Configuration"
|
||||||
visible = "advanced__2"
|
visible = "advanced__2"
|
||||||
pattern.regexp = '^([0-9.]{7,15}|[0-9a-fA-F:]+)$'
|
pattern.regexp = '^([0-9.]{7,15}|[0-9a-fA-F:]+)$'
|
||||||
pattern.error = "Not an ip"
|
pattern.error = "Not an ip"
|
||||||
|
|
||||||
[main.hotspot3]
|
[main.hotspot3]
|
||||||
name = "Hotspot 3"
|
name = "Hotspot 3"
|
||||||
visible = "! no_antenna && multissid >= 3"
|
visible = "! no_antenna && multissid >= 3"
|
||||||
|
@ -188,7 +193,7 @@ name = "Configuration"
|
||||||
bind = "array_settings()"
|
bind = "array_settings()"
|
||||||
pattern.regexp = '^[\w \-]{1,32}$'
|
pattern.regexp = '^[\w \-]{1,32}$'
|
||||||
pattern.error = "SSID in this app are limited to letter, number space, dash and underscores."
|
pattern.error = "SSID in this app are limited to letter, number space, dash and underscores."
|
||||||
|
|
||||||
[main.hotspot3.wifi_secure__3]
|
[main.hotspot3.wifi_secure__3]
|
||||||
ask = "Secure"
|
ask = "Secure"
|
||||||
type = "boolean"
|
type = "boolean"
|
||||||
|
@ -199,15 +204,15 @@ name = "Configuration"
|
||||||
type = "string"
|
type = "string"
|
||||||
bind = "array_settings()"
|
bind = "array_settings()"
|
||||||
redact = true
|
redact = true
|
||||||
visible = "wifi_secure__3"
|
visible = "wifi_secure__3"
|
||||||
pattern.regexp = '^[a-zA-Z0-9]{8,63}$'
|
pattern.regexp = '^[a-zA-Z0-9]{8,63}$'
|
||||||
pattern.error = "Only printable alphanumeric characters are permitted in your password. Maximal size 63 chars"
|
pattern.error = "Only printable alphanumeric characters are permitted in your password. Maximal size 63 chars"
|
||||||
|
|
||||||
[main.hotspot3.advanced__3]
|
[main.hotspot3.advanced__3]
|
||||||
ask = "Advanced settings"
|
ask = "Advanced settings"
|
||||||
type = "boolean"
|
type = "boolean"
|
||||||
bind = "array_settings()"
|
bind = "array_settings()"
|
||||||
|
|
||||||
[main.hotspot3.ip4_nat_prefix__3]
|
[main.hotspot3.ip4_nat_prefix__3]
|
||||||
ask = "IPv4 NAT prefix (/24)"
|
ask = "IPv4 NAT prefix (/24)"
|
||||||
type = "string"
|
type = "string"
|
||||||
|
@ -215,7 +220,7 @@ name = "Configuration"
|
||||||
visible = "advanced__3"
|
visible = "advanced__3"
|
||||||
pattern.regexp = '^[0-9.]{7,15}$'
|
pattern.regexp = '^[0-9.]{7,15}$'
|
||||||
pattern.error = "Please provide a valid IP"
|
pattern.error = "Please provide a valid IP"
|
||||||
|
|
||||||
[main.hotspot3.ip6_net__3]
|
[main.hotspot3.ip6_net__3]
|
||||||
ask = "IPv6 delegated prefix"
|
ask = "IPv6 delegated prefix"
|
||||||
type = "string"
|
type = "string"
|
||||||
|
@ -223,13 +228,13 @@ name = "Configuration"
|
||||||
visible = "advanced__3"
|
visible = "advanced__3"
|
||||||
pattern.regexp = '^[0-9a-fA-F:]+$'
|
pattern.regexp = '^[0-9a-fA-F:]+$'
|
||||||
pattern.error = "Please provide a valid IPv6 Prefix"
|
pattern.error = "Please provide a valid IPv6 Prefix"
|
||||||
|
|
||||||
[main.hotspot3.ip6_firewall__3]
|
[main.hotspot3.ip6_firewall__3]
|
||||||
ask = "IPv6 firewall"
|
ask = "IPv6 firewall"
|
||||||
type = "boolean"
|
type = "boolean"
|
||||||
bind = "array_settings()"
|
bind = "array_settings()"
|
||||||
visible = "advanced__3"
|
visible = "advanced__3"
|
||||||
|
|
||||||
[main.hotspot3.dns__3]
|
[main.hotspot3.dns__3]
|
||||||
ask = "DNS resolvers"
|
ask = "DNS resolvers"
|
||||||
type = "tags"
|
type = "tags"
|
||||||
|
@ -237,4 +242,4 @@ name = "Configuration"
|
||||||
visible = "advanced__3"
|
visible = "advanced__3"
|
||||||
pattern.regexp = '^([0-9.]{7,15}|[0-9a-fA-F:]+)$'
|
pattern.regexp = '^([0-9.]{7,15}|[0-9a-fA-F:]+)$'
|
||||||
pattern.error = "Not an ip"
|
pattern.error = "Not an ip"
|
||||||
|
|
||||||
|
|
|
@ -31,11 +31,7 @@ get__no_antenna() {
|
||||||
then
|
then
|
||||||
echo "value: false"
|
echo "value: false"
|
||||||
else
|
else
|
||||||
cat << EOF
|
echo "value: true"
|
||||||
value: false
|
|
||||||
ask: Wifi antenna correctly detected
|
|
||||||
style: info
|
|
||||||
EOF
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,6 +88,8 @@ EOF
|
||||||
echo " $device: $device"
|
echo " $device: $device"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "value: '$(ynh_app_setting_get $app wifi_device)'"
|
||||||
}
|
}
|
||||||
|
|
||||||
get__array_settings() {
|
get__array_settings() {
|
||||||
|
|
|
@ -45,7 +45,7 @@ ynh_abort_if_errors
|
||||||
#=================================================
|
#=================================================
|
||||||
# STOP SYSTEMD SERVICE
|
# STOP SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Stopping a systemd service..."
|
ynh_script_progression --message="Stopping the hotspot service ... (this may take some time)"
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$service_name --action="stop" --log_path=systemd #--line_match="Started YunoHost Wifi Hotspot"
|
ynh_systemd_action --service_name=$service_name --action="stop" --log_path=systemd #--line_match="Started YunoHost Wifi Hotspot"
|
||||||
|
|
||||||
|
@ -160,7 +160,7 @@ yunohost service add $service_name --description "Creates a Wi-Fi access point"
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SYSTEMD SERVICE
|
# START SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Starting a systemd service..."
|
ynh_script_progression --message="Starting the hotspot service..."
|
||||||
|
|
||||||
hot_reload_usb_wifi_cards
|
hot_reload_usb_wifi_cards
|
||||||
wifi_device=$(iw_devices | awk -F\| '{ print $1 }')
|
wifi_device=$(iw_devices | awk -F\| '{ print $1 }')
|
||||||
|
|
Loading…
Add table
Reference in a new issue