v1.5.5
~全面适配ax6s等小米镜像化系统设备 ~重做小米SSH工具,现在支持各类小米路由设备软件固化SSH ~重写开机启动逻辑,现在支持Padavan、梅林及小米镜像化系统
This commit is contained in:
43
scripts/misnap_init.sh
Normal file
43
scripts/misnap_init.sh
Normal file
@@ -0,0 +1,43 @@
|
||||
#!/bin/sh
|
||||
# Copyright (C) Juewuy
|
||||
|
||||
clashdir=/data/clash
|
||||
profile=/etc/profile
|
||||
|
||||
log(){
|
||||
dir=$clashdir/ui/log
|
||||
echo `date`ssh状态获取 >> $dir
|
||||
nvram get telnet_en >> $dir
|
||||
nvram get ssh_en >> $dir
|
||||
nvram get uart_en >> $dir
|
||||
uci -c /usr/share/xiaoqiang get xiaoqiang_version.version.CHANNEL >> $dir
|
||||
grep 'channel=.*' /etc/init.d/dropbear >> $dir
|
||||
/etc/init.d/dropbear enabled
|
||||
echo dropbear自启状态:$? >> $dir
|
||||
}
|
||||
|
||||
#还原SSH秘钥
|
||||
ln -sf $clashdir/dropbear_rsa_host_key /etc/dropbear/dropbear_rsa_host_key
|
||||
|
||||
#h初始化环境变量
|
||||
echo "alias clash=\"$clashdir/clash.sh\"" >> $profile
|
||||
echo "export clashdir=\"$clashdir\"" >> $profile
|
||||
|
||||
#设置init.d服务并启动clash服务
|
||||
ln -sf $clashdir/clashservice /etc/init.d/clash
|
||||
chmod 755 /etc/init.d/clash
|
||||
|
||||
log
|
||||
|
||||
[ -f $clashdir/.dis_startup ] || {
|
||||
log_file=`uci get system.@system[0].log_file`
|
||||
while [ "$i" -lt 10 ];do
|
||||
sleep 3
|
||||
[ -n "$(grep 'init complete' $log_file)" ] && i=10 || i=$((i+1))
|
||||
done
|
||||
/etc/init.d/clash start
|
||||
/etc/init.d/clash enable
|
||||
}
|
||||
|
||||
sleep 10
|
||||
log
|
||||
Reference in New Issue
Block a user