-
Notifications
You must be signed in to change notification settings - Fork 29
/
system76-nm-restart
executable file
·39 lines (34 loc) · 1.46 KB
/
system76-nm-restart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh
# system76-driver: Universal driver for System76 computers
# Copyright (C) 2005-2016 System76, Inc.
#
# This file is part of `system76-driver`.
#
# `system76-driver` is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# `system76-driver` is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with `system76-driver`; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# Starting with 16.04, there are WiFi reliability issues when resuming from
# suspend, at least with certain WiFi cards. In particular, this problem seems
# to effect Haswell generation cards like the 7260. It does not seem to effect
# Skylake generation cards like the 3165, 8260.
#
# This seems fundamentally a user-space issue, not a kernel issue.
#
# This script is installed at /lib/systemd/system-sleep/system76-nm-restart.
set -e
if [ "$2" = "suspend" ] || [ "$2" = "hybrid-sleep" ]; then
case "$1" in
pre) true ;;
post) sleep 1 && sudo systemctl restart NetworkManager ;;
esac
fi