-
Notifications
You must be signed in to change notification settings - Fork 18
/
service-pwr-mgmnt-disable.sh
executable file
·51 lines (34 loc) · 1.16 KB
/
service-pwr-mgmnt-disable.sh
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
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
# pi-ap: These scripts configure a Raspberry Pi into a wireless Access Point
# Source: https://github.com/f1linux/pi-ap
# Version: 01.10.02
# License: GPL 3.0
# Script Author: Terrence Houlahan Linux & Network Engineer
# Contact: [email protected]
# Linkedin: www.linkedin.com/in/terrencehoulahan
# Do not edit below sources
source "${BASH_SOURCE%/*}/variables.sh"
source "${BASH_SOURCE%/*}/functions.sh"
cat <<EOF> $PATHSCRIPTS/pwr-mgmnt-wifi-disable.sh
#!/bin/bash
iw dev wlan0 set power_save off
EOF
chmod 700 $PATHSCRIPTS/pwr-mgmnt-wifi-disable.sh
echo "Created: $PATHSCRIPTS/pwr-mgmnt-wifi-disable.sh"
cat <<EOF> /etc/systemd/system//pwr-mgmnt-wifi-disable.service
[Unit]
Description=Disable WiFi Power Management
Requires=network-online.target
After=hostapd.service
[Service]
User=root
Group=root
Type=oneshot
ExecStart=$PATHSCRIPTS/pwr-mgmnt-wifi-disable.sh
[Install]
WantedBy=multi-user.target
EOF
chmod 644 /etc/systemd/system/pwr-mgmnt-wifi-disable.service
systemctl enable pwr-mgmnt-wifi-disable.service
systemctl start pwr-mgmnt-wifi-disable.service
echo "Created: /etc/systemd/system/pwr-mgmnt-wifi-disable.service"