Skip to content

Instantly share code, notes, and snippets.

@chwnam
Last active July 17, 2019 08:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chwnam/fb5a9006087dc2a0c745e2ba62cef1f6 to your computer and use it in GitHub Desktop.
Save chwnam/fb5a9006087dc2a0c745e2ba62cef1f6 to your computer and use it in GitHub Desktop.
무선 네트워크 초기화 8821CE 무선랜 모듈을 초기화 시키는 간단한 쉘 스크립트
#!/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