op-packages/telegrambot/root/etc/init.d/telegrambot
github-actions[bot] 32600acc60 🌴 Sync 2026-03-05 23:51:42
2026-03-05 23:51:42 +08:00

29 lines
435 B
Bash
Executable File

#!/bin/sh /etc/rc.common
# Copyright (c) 2011-2015 OpenWrt.org
START=99
start() {
if [ ! -f "/var/run/telegrambot.pid" ]; then
echo "1" > /var/run/telegrambot.pid
/usr/lib/telegrambot/telegrambot >/dev/null 2>&1 &
fi
return 0
}
stop() {
rm -f /var/run/telegrambot.pid
kill $(pgrep -f telegrambot/telegrambot) >/dev/null 2>&1
}
restart(){
stop
sleep 1
start
}
boot() {
(sleep 5 && start >/dev/null 2>&1) &
return 0
}