mirror of
https://github.com/elenapan/dotfiles.git
synced 2025-12-27 07:44:56 +08:00
Former-commit-id: 6c9faff508
Former-commit-id: 17d19dad6bdde82ff8c2bcc983f87a49bb4a5e6f
Former-commit-id: 4f66d0d17a4bb9ceb3eedf158bae309fa71fb8b1
17 lines
397 B
Bash
Executable file
17 lines
397 B
Bash
Executable file
# needs work! not thoroughly tested...
|
|
# Replace with your own interface names here
|
|
WIRELESS_IF="wlp3s0"
|
|
WIRED_IF="enp2s0f0"
|
|
|
|
WIFI="$(ifconfig | grep -A 1 $WIRELESS_IF | grep "inet" | awk '{print $2}')"
|
|
ETHER="$(ifconfig | grep -A 1 $WIRED_IF | grep "inet" | awk '{print $2}')"
|
|
|
|
if [ ${#ETHER} -eq "0" ]; then
|
|
if [ ${#WIFI} -eq "0" ]; then
|
|
echo ""
|
|
else
|
|
echo ""
|
|
fi
|
|
else
|
|
echo ""
|
|
fi
|