mirror of
https://github.com/juewuy/ShellCrash.git
synced 2024-11-16 03:32:34 +08:00
4dc4607ea3
~全面适配ax6s等小米镜像化系统设备 ·支持procd守护进程 ·支持设置开机启动 ·支持自动开启SSH及备份还原SSH秘钥 ~重做小米SSH工具,现在支持各类小米路由设备软件固化SSH(待测试) ~重写自启逻辑,现在支持Padavan、梅林开关开机启动功能
24 lines
574 B
Bash
24 lines
574 B
Bash
#!/bin/sh
|
|
# Copyright (C) Juewuy
|
|
|
|
clashdir=/data/clash
|
|
profile=/etc/profile
|
|
|
|
#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
|
|
|
|
if [ ! -f $clashdir/.dis_startup ];then
|
|
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
|
|
fi
|