发布于 2016-03-20 13:22:38
请打开一个终端并做:
gksudo gedit /etc/systemd/system/wifi-resume.service如果您没有文本编辑器gedit,请使用nano或kate或传单垫。一个新的空文件将打开。增加以下内容:
[Unit]
Description=Local system resume actions
After=suspend.target
[Service]
Type=oneshot
ExecStart=/bin/systemctl restart network-manager.service
[Install]
WantedBy=suspend.target仔细校对两次,保存并关闭文本编辑器。
现在做:
sudo chmod +x /etc/systemd/system/wifi-resume.service其次是:
sudo systemctl enable wifi-resume.service我建议你重新启动。测试并让我们听听你的报告。
发布于 2016-05-24 23:45:53
另一种解决办法类似于问题中提到的特里斯坦T号的nmcli (没有nm,这不再是特里斯坦提到的选项):
nmcli radio wifi on我使用奥维斯·隆's 对类似问题的回答在16.04 LTS上为我的笔记本电脑(一台戴尔精密电脑)提供无线网络自动恢复功能。
我创建了/etc/pm/瞌睡.d/10_resume_wifi
#!/bin/sh
case "${1}" in
resume|thaw)
nmcli radio wifi off && nmcli radio wifi on;;
esac然后是一个sudo chmod +x /etc/pm/sleep.d/10_resume_wifi,以使该文件可执行。
如果您想知道双分号或者像我一样的孤立的闭括号,请参阅http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_07_03.html --这就是案例语法的工作原理。
发布于 2020-12-10 12:50:20
这个线程中接受的答案对我不起作用,也不适用于任何替代解决方案。我必须将以下服务文件添加为/etc/systemd/system/wifi-resume.service
[Unit]
Description=Restart Network Manager at resume (after suspend)
After=suspend.target
After=hibernate.target
After=hybrid-sleep.target
[Service]
Type=oneshot
# note: the following also unloads iwlwifi
ExecStart=/usr/sbin/modprobe -r iwldvm
# note: the following also loads iwldvm
ExecStart=/usr/sbin/modprobe iwlwifi
[Install]
WantedBy=suspend.target
WantedBy=hibernate.target
WantedBy=hybrid-sleep.target然后使用sudo systemctl enable wifi-resume.service启用
作为备份,在测试上面的内容时,我创建了一个bash脚本,其中包含以下内容
#!/bin/bash
echo {MY_PASSWORD} | sudo -S modprobe -r iwldvm
echo {MY_PASSWORD} | sudo -S modprobe iwlwifi
echo {MY_PASSWORD} | sudo -S service network-manager restart
notify-send "Wifi: reloaded."
exit并将其绑定到自定义键盘快捷键。
https://askubuntu.com/questions/748113
复制相似问题