mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-29 22:15:13 +08:00
🌴 Sync 2026-03-05 23:51:42
This commit is contained in:
1 parent
97c049ed0a
commit
0acff03804
14253 files changed
+3893239
No files matched your search
@@ -0,0 +1,35 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
|
||||
log_file="/tmp/log/autoshell.log"
|
||||
|
||||
start() {
|
||||
state=$(pgrep -f "/etc/autoshell.sh")
|
||||
|
||||
config_content=$(cat /etc/config/autoshell)
|
||||
if echo "$config_content" | grep -q "禁用"; then
|
||||
echo "[$(date "+%Y-%m-%d %H:%M:%S")]: 脚本已禁用" >> "$log_file"
|
||||
return 1
|
||||
|
||||
else
|
||||
/etc/autoshell.sh &
|
||||
echo "[$(date "+%Y-%m-%d %H:%M:%S")]: 已启动认证脚本" >> "$log_file"
|
||||
fi
|
||||
}
|
||||
|
||||
stop() {
|
||||
kill -9 $(pgrep -f "/etc/autoshell.sh") 2>/dev/null
|
||||
echo "$(date "+%Y-%m-%d %H:%M:%S"): 已停止认证" >>
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
sleep 1
|
||||
start
|
||||
echo "$(date "+%Y-%m-%d %H:%M:%S"): 已重新启动 /etc/autoshell.sh"
|
||||
}
|
||||
|
||||
disable() {
|
||||
echo "禁用功能未实现"
|
||||
}
|
||||
Reference in new issue
Block a user