Skip to content

Commit

Permalink
v6.31
Browse files Browse the repository at this point in the history
+ DietPi-Software | GMediaRender/WireGuard: Update network info before reading info file on service start. This prevents invalid IP info if DHCP lease on boot finishes before obtain_network_details is called or if during session the device is connected to a different network or DHCP applies a new IP and services are (re)started afterwards. Planned long-term solution is a set of functions to read network info directly from system instead of relying on correct /run/dietpi/.network content (ToDo).
  • Loading branch information
MichaIng committed May 11, 2020
1 parent 7fb8b09 commit e5fc3bb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions dietpi/dietpi-software
Original file line number Diff line number Diff line change
Expand Up @@ -4627,7 +4627,7 @@ Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin-

mkdir -p /var/lib/dietpi/dietpi-software/installed/dietpi-nordvpn

G_WHIP_MSG "DietPi-NordVPN has been installed.\nOnce DietPi-Software has finished all other installations, you can run the GUI using the following command:\n - dietpi-nordvpn"
G_WHIP_MSG '[ INFO ] DietPi-NordVPN has been installed.\n\nOnce DietPi-Software has finished all other installations, you can run the GUI using the following command:\n - dietpi-nordvpn'

fi

Expand Down Expand Up @@ -9541,6 +9541,7 @@ Address = 10.9.0.1/24
PrivateKey = $(<server_private.key)
ListenPort = $port

PreUp = /boot/dietpi/func/obtain_network_details
PostUp = sysctl net.ipv4.conf.%i.forwarding=1 net.ipv4.conf.\$(mawk 'NR==3' /run/dietpi/.network).forwarding=1
PostUp = sysctl net.ipv6.conf.\$(mawk 'NR==3' /run/dietpi/.network).accept_ra=2
PostUp = sysctl net.ipv6.conf.%i.forwarding=1 net.ipv6.conf.\$(mawk 'NR==3' /run/dietpi/.network).forwarding=1
Expand Down Expand Up @@ -11909,6 +11910,7 @@ After=network-online.target sound.target dietpi-boot.service

[Service]
User=gmrender
ExecStartPre=/boot/dietpi/func/obtain_network_details
ExecStartPre=+/bin/dash -c 'systemctl set-environment ACTIVE_IP=\$(mawk 'NR==4' /run/dietpi/.network)'
ExecStart=/usr/local/bin/gmediarender -u '$G_HW_UUID' -f '$(</etc/hostname)' --gstout-audiosink=alsasink --gstout-audiodevice=default --logfile=stdout -I "\$ACTIVE_IP"

Expand Down Expand Up @@ -13487,12 +13489,11 @@ _EOF_
if [[ -f '/etc/systemd/system/dietpi-nordvpn.service' ]]; then

systemctl disable --now dietpi-nordvpn
rm /etc/systemd/system/dietpi-nordvpn.service
rm -R /etc/systemd/system/dietpi-nordvpn.service*

fi
rm -Rf /etc/openvpn/ovpn_{tcp,udp}/*nordvpn*
rm -Rf /etc/openvpn/ovpn_{tcp,udp}/*nordvpn* /var/lib/dietpi/dietpi-software/installed/dietpi-nordvpn
rmdir --ignore-fail-on-non-empty /etc/openvpn/ovpn_{tcp,udp}
[[ -d '/var/lib/dietpi/dietpi-software/installed/dietpi-nordvpn' ]] && rm -R /var/lib/dietpi/dietpi-software/installed/dietpi-nordvpn

fi

Expand Down

0 comments on commit e5fc3bb

Please sign in to comment.