@@ -98,11 +98,12 @@ ckstatus(){
98
98
# 检查执行权限
99
99
[ ! -x $clashdir /start.sh ] && chmod +x $clashdir /start.sh
100
100
# 检查/tmp内核文件
101
- for file in ` ls -F /tmp | grep -v [/\$ ] | grep -iE ' ^clash$|^clash-linux*' ` ; do
101
+ for file in ` ls -F /tmp | grep -v [/\$ ] | grep -v ' \ ' | grep -iE ' ^clash$|^clash-linux*' ` ; do
102
+ file=/tmp/$file
102
103
chmod +x $file
103
104
tmp_version=$( $file -v 2> /dev/null)
104
105
if [ -n " $tmp_version " ]; then
105
- echo -e " \033[32m发现可用的内核文件 \033[0m"
106
+ echo -e " 发现可用的内核文件: \033[36m $file \033[0m "
106
107
read -p " 是否加载?(1/0) > " res
107
108
[ " $res " = 1 ] && {
108
109
echo -e " 1 Clash内核"
@@ -114,7 +115,7 @@ ckstatus(){
114
115
3) clashcore=clash.meta ;;
115
116
* ) clashcore=clash ;;
116
117
esac
117
- mv -f $file $bindir /clash
118
+ mv -f $file $bindir /clash && echo -e " \033[32m内核加载完成!\033[0m " && sleep 1
118
119
setconfig clashcore $clashcore
119
120
}
120
121
else
@@ -127,13 +128,21 @@ ckstatus(){
127
128
done
128
129
# 检查/tmp配置文件
129
130
[ -x $bindir /clash ] && \
130
- for file in ` ls -F /tmp | grep -v [/\$ ] | grep -iE ' .yaml$|.yml$' ` ; do
131
+ for file in ` ls -F /tmp | grep -v [/\$ ] | grep -v ' \ ' | grep -iE ' .yaml$|.yml$' ` ; do
132
+ file=/tmp/$file
131
133
$bindir /clash -t -d $bindir -f $file & > /dev/null && {
132
- echo -e " \033[32m发现可用的YAML配置文件\033[0m"
133
- echo $file
134
+ echo -e " 发现可用的YAML配置文件: \033[36m$file \033[0m "
134
135
read -p " 加载为config.yaml配置文件/或者移除该文件?(1/0) > " res
135
- [ " $res " = 1 ] && mv -f $file $clashdir /config.yaml
136
- [ " $res " = 0 ] && rm -rf $file
136
+ [ " $res " = 1 ] && {
137
+ mv -f $file $clashdir /config.yaml
138
+ echo -e " \033[32m配置文件加载完成!\033[0m "
139
+ sleep 1
140
+ }
141
+ [ " $res " = 0 ] && {
142
+ rm -rf $file
143
+ echo -e " \033[32m配置文件已移除!\033[0m "
144
+ sleep 1
145
+ }
137
146
echo -----------------------------------------------
138
147
}
139
148
done
0 commit comments