Ubuntu系统挂起后Wifi图标不见了的解决方案(16.04 LTS 测试好使)

主要参考以下网页的解决方案:

https://askubuntu.com/questions/898297/wifi-signal-icon-switches-to-ethernet-icon-up-down-arrows-after-suspend/899304#899304

1.创建/lib/systemd/system-sleep/iwlwifi-reset:

sudo gedit /lib/systemd/system-sleep/iwlwifi-reset

2.在新建的文本中,粘贴如下代码:

#!/bin/sh

# NAME: /lib/systemd/system-sleep/iwlwifi-reset
# DESC: Resets Intel WiFi after a long suspend.
# DATE: Apr 1, 2017. Modified April 8, 2017.

# NOTE: Per AU comment restart network.

MYNAME=$0

restart_wifi() {
    /usr/bin/logger $MYNAME 'restart_wifi BEGIN'
#    /sbin/modprobe -v -r iwldvm # This removes iwlwifi too
#    /sbin/modprobe -v iwlwifi   # This starts iwldvm too
    systemctl restart NetworkManager.service
    /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

3.使用以下命令将脚本标记为可执行:

sudo chmod a+x /lib/systemd/system-sleep/iwlwifi-reset

4.解决问题!可以手工挂起系统测试..

猜你喜欢

转载自blog.csdn.net/wmyan/article/details/82288065