Last active
July 17, 2019 08:41
-
-
Save chwnam/fb5a9006087dc2a0c745e2ba62cef1f6 to your computer and use it in GitHub Desktop.
무선 네트워크 초기화 8821CE 무선랜 모듈을 초기화 시키는 간단한 쉘 스크립트
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
#!/bin/bash | |
function wlan_id() { | |
echo $(rfkill -nr | grep phy | cut -f 1 -d ' ') | |
} | |
function wait_a_moment() { | |
local time=3 | |
echo "약 ${time}초간 대기합니다..." | |
sleep ${time} | |
} | |
ID=$(wlan_id) | |
echo "무선 네트워크 ID ${ID}를 잠시 끕니다." | |
rfkill block ${ID} | |
wait_a_moment | |
echo "8821ce 모듈을 제거합니다. 관리자 권한이 필요합니다." | |
sudo rmmod 8821ce | |
wait_a_moment | |
echo "8821ce 모듈을 다시 삽입합니다. 관리자 권한이 필요합니다." | |
sudo modprobe 8821ce | |
wait_a_moment | |
ID=$(wlan_id) | |
echo "무선 네트워크 ID ${ID}를 다시 켭니다. 무선 네트워크가 다시 잘 동작하나요?" | |
rfkill unblock ${ID} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment