WLAN state disabled after resume from suspended machine

After resuming from suspension, KDE Neon and its WLAN is sometimes not automatically enabled again. I have to manually enable it through the GUI or by the command “nmcli wifi radio on”.

What could be the issue?

Found an answer in: networking - How to prevent wifi sleep after suspend - Ask Ubuntu

I had to add sleep for 5 seconds in the script to make the restart of the network manager work properly:

File path: /lib/systemd/system-sleep/wifi-reset

#!/bin/sh

MYNAME=$0

restart_wifi() {
    /usr/bin/logger $MYNAME 'restart_wifi BEGIN'
    sleep 5 && systemctl restart NetworkManager.service
    /usr/bin/logger 'systemctl restart NetworkManager.service (SUPPRESSED)'
    /usr/bin/logger $MYNAME 'restart_wifi END'
}

/usr/bin/logger $MYNAME 'case=[' ${1}' ]'
case "${1}/${2}" in
    hibernate|suspend|pre*)
      ;;
    resume|thaw|post*)
      restart_wifi;;
esac