📄 remove-old
字号:
#!/bin/bash -xif [ "$1" == "" ]; then KERN=/lib/modules/`uname -r`/buildelse KERN="$1"fiecho ${KERN} | grep "/\$" || KERN="${KERN}/"function ask_comment(){ while true; do read -p "Above definitions found. Comment out? [y], n " case ${REPLY} in n) return 1;; ""|y) sed -i \ -e "s:^\(CONFIG_IEEE80211.*\):#\1:" \ ${KERN}/.config || return 1 sed -i -r \ -e "s:^(#(un)?def.*CONFIG_IEEE80211.*):/*\1*/:" \ ${KERN}/include/linux/autoconf.h || return 1 return 0;; *) continue;; esac done || return 1}function ask_remove(){ while true; do read -p "Above files found. Remove? [y],n " case ${REPLY} in n) return 1;; ""|y) find ${KERN} -type f -name 'ieee80211*' | \ while read fn; do [ ! -d $fn ] && (rm -f ${fn} || return 1) done || return 1 return 0;; *) continue;; esac done || return 1}function do_check(){ echo -e "Checking in ${1} for ieee80211 components...\n" FILES=`find ${1} -type f -name 'ieee80211*'` if [ -n "${FILES}" ]; then echo -e "${FILES}\n" | sed -e "s# #\n#" ask_remove || return 1 fi ( egrep "^(CONFIG_IEEE80211.*)" ${1}/.config || \ egrep "^#(un)?def.*(CONFIG_IEEE80211.*)" \ ${1}/include/linux/autoconf.h ) && \ (ask_comment || return 1) return 0}do_check ${KERN}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -