-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[bin] merge wired and wireless scripts
- Loading branch information
1 parent
4637134
commit 0f71421
Showing
3 changed files
with
25 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/sh | ||
|
||
# determine networking device | ||
if [[ "$1" == 'wired' ]]; then | ||
device="$(ip link show | sed 's/^[0-9]*: //; s/:.*//' | grep '^e')" | ||
elif [[ "$1" == 'wireless' ]]; then | ||
device="$(ip link show | sed 's/^[0-9]*: //; s/:.*//' | grep '^w')" | ||
else | ||
echo "$0 <wired|wireless>" | ||
exit 1 | ||
fi | ||
|
||
# shut down networking processes | ||
killall -9 dhcpcd | ||
if [[ "$1" == 'wireless' ]]; then | ||
killall -9 wpa_supplicant | ||
fi | ||
ip link set "$device" down | ||
|
||
# start up networking processes | ||
ip link set "$device" up | ||
if [[ "$1" == 'wireless' ]]; then | ||
wpa_supplicant -Bi "$device" -c /root/wpa_supplicant.conf | ||
fi | ||
dhcpcd "$device" --debug --debug |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.