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

Merge pull request #119 from YunoHost-Apps/race-condition-at-boot

Race condition at boot with VPN client
This commit is contained in:
Alexandre Aubin 2023-12-31 17:34:47 +01:00 committed by GitHub
commit 4a7aa4072f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -15,7 +15,8 @@ set_nat() {
iptables -w -t nat -A POSTROUTING -o "${gateway_interface}" -j MASQUERADE
}
if systemctl -q is-active __SERVICE_NAME__; then
ynh_hotspot_state=$(systemctl is-active __SERVICE_NAME__)
if [[ "${ynh_hotspot_state}" == "active" || "${ynh_hotspot_state}" == "activating" ]]; then
old_gateway_interface=$(yunohost app setting __APP__ gateway_interface)
new_gateway_interface=$(ip route get 1.2.3.4 | awk '{ print $5; }')