Initial commit.
This commit is contained in:
parent
bf90d8f290
commit
edaa8362cd
3 changed files with 25 additions and 0 deletions
8
install.sh
Executable file
8
install.sh
Executable file
|
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/bash
|
||||||
|
echo "Installing wifi reset service to /opt/wifi-reset."
|
||||||
|
mkdir -p /opt/wifi-reset
|
||||||
|
cp -f wifi-reset.sh /opt/wifi-reset/wifi-reset.sh
|
||||||
|
echo "Installing systemd service to run at boot."
|
||||||
|
cp -f wifi-reset.service /lib/systemd/system/wifi-reset.service
|
||||||
|
echo "Enabling systemd service."
|
||||||
|
systemctl enable wifi-reset.service > /dev/null
|
||||||
10
wifi-reset.service
Normal file
10
wifi-reset.service
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Wireless Network Reset
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
RemainAfterExit=true
|
||||||
|
ExecStart=/bin/bash /opt/wifi-reset/wifi-reset.sh
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
7
wifi-reset.sh
Executable file
7
wifi-reset.sh
Executable file
|
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# Bring all wifi interfaces down.
|
||||||
|
# Identify wifi interfaces as rows from standard output of iwconfig (NOT standard
|
||||||
|
# error, those are non-wifi interfaces) which start without whitespace.
|
||||||
|
iwconfig 2> /dev/null | grep -o '^[[:alnum:]]\+' | while read x; do ifdown $x; done
|
||||||
|
# Bring all wifi interfaces up.
|
||||||
|
iwconfig 2> /dev/null | grep -o '^[[:alnum:]]\+' | while read x; do ifup $x; done
|
||||||
Loading…
Reference in a new issue