mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-10-31 01:05:13 +08:00
update 2026-09-24 16:56:26
This commit is contained in:
1 parent
b31a5c3878
commit
e4cee331e9
6885 files changed
+3240523
No files matched your search
@@ -0,0 +1,3 @@
|
||||
|
||||
config qiyougamebooster 'config'
|
||||
option enabled '0'
|
||||
@@ -0,0 +1,37 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2007 OpenWrt.org
|
||||
|
||||
USE_PROCD=1
|
||||
STOP=99
|
||||
START=99
|
||||
|
||||
CONF="qiyougamebooster"
|
||||
PROG="/usr/bin/qiyougamebooster.sh"
|
||||
|
||||
start_service() {
|
||||
config_load "$CONF"
|
||||
|
||||
local enabled
|
||||
config_get_bool enabled "config" "enabled" "0"
|
||||
[ "$enabled" -eq "1" ] || return 1
|
||||
|
||||
procd_open_instance "$CONF"
|
||||
|
||||
procd_set_param command "$PROG"
|
||||
procd_append_param command start
|
||||
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
$PROG stop
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "$CONF"
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
#!/bin/sh
|
||||
|
||||
ACTION=$1
|
||||
|
||||
url="https://static.qiyou.cn/upgrade/ljb/plugin/qyplug.sh"
|
||||
sh_file="/tmp/qyplug.sh"
|
||||
ret_file="/tmp/qyplug.ret"
|
||||
get_file="/tmp/qyplug.get"
|
||||
pid_file="/tmp/qyplug.pid"
|
||||
#get_qyplug="wget -q -T 30 \"${url}\" -O \"${sh_file}\" --no-check-certificate"
|
||||
get_qyplug="curl -s -k -L -m 30 \"${url}\" -o \"${sh_file}\""
|
||||
|
||||
stop(){
|
||||
pid=`cat ${get_file} 2> /dev/null`
|
||||
echo "qy_acc stop: ${pid}"
|
||||
[ "${pid}" = "" ] || kill -9 ${pid}
|
||||
rm -rf ${get_file}
|
||||
|
||||
sleep 1
|
||||
|
||||
if [ -e /tmp/qyplug.sh ]; then
|
||||
sh /tmp/qyplug.sh stop
|
||||
rm -rf /tmp/qyplug.sh
|
||||
fi
|
||||
|
||||
sleep 2
|
||||
rm -rf ${ret_file}
|
||||
|
||||
if [ -e /tmp/qy ]; then
|
||||
cd /tmp/qy && ./init.sh stop
|
||||
rm -rf /tmp/qy
|
||||
fi
|
||||
}
|
||||
|
||||
start(){
|
||||
pid=$$
|
||||
echo ${pid} > ${get_file}
|
||||
echo "qy_acc start: ${pid}"
|
||||
|
||||
while true
|
||||
do
|
||||
rm -rf ${sh_file} ${ret_file}
|
||||
|
||||
sh -c "${get_qyplug}"
|
||||
if [ -e ${sh_file} ]; then
|
||||
export QY_NOT_INSTALL=1
|
||||
sh ${sh_file} &
|
||||
fi
|
||||
|
||||
sleep 3
|
||||
[ ! -e ${ret_file} ] || break
|
||||
sleep 30
|
||||
done
|
||||
|
||||
rm -rf ${get_file}
|
||||
}
|
||||
|
||||
switch(){
|
||||
act=$1
|
||||
|
||||
if [ ! -d /tmp/qy ]; then
|
||||
echo "没安装"
|
||||
return
|
||||
fi
|
||||
|
||||
if [ "${act}" = "on" ]; then
|
||||
cd /tmp/qy && ./init.sh &> /dev/null
|
||||
elif [ "${act}" = "off" ]; then
|
||||
cd /tmp/qy && ./init.sh stop &> /dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
status(){
|
||||
status=`cat ${ret_file} 2> /dev/null`
|
||||
get=`cat ${get_file} 2> /dev/null`
|
||||
pid=`cat ${pid_file} 2> /dev/null`
|
||||
acc=`pidof qy_acc 2> /dev/null`
|
||||
|
||||
if [ "${status}" = "succeeded" ]; then
|
||||
if [ ! -d /tmp/qy ]; then
|
||||
printf "NOT ENABLED"
|
||||
elif [ "${acc}" = "" ]; then
|
||||
printf "CLOSED"
|
||||
elif [ -d /sys/class/net/tun31 ] || [ -d /sys/class/net/tun32 ]; then
|
||||
printf "BOOSTING"
|
||||
else
|
||||
printf "RUNNING"
|
||||
fi
|
||||
return
|
||||
fi
|
||||
if [ "${status}" = "notsupport" ]; then
|
||||
printf "NOT SUPPORTED"
|
||||
return
|
||||
fi
|
||||
if [ "${status}" = "getpkgerr" ]; then
|
||||
printf "DOWNLOADING"
|
||||
return
|
||||
fi
|
||||
if [ "${get}" != "" ] && [ -e "/proc/${get}" ]; then
|
||||
printf "INSTALLING"
|
||||
return
|
||||
fi
|
||||
if [ "${pid}" != "" ] && [ -e "/proc/${pid}" ]; then
|
||||
printf "INSTALLING"
|
||||
return
|
||||
fi
|
||||
if [ ! -d /tmp/qy ]; then
|
||||
printf "NOT ENABLED"
|
||||
return
|
||||
fi
|
||||
printf "NOT RUNNING"
|
||||
}
|
||||
|
||||
version(){
|
||||
ver=`sed -n 's;^VERSION=;;p' /tmp/qy/etc/PKG_INFO 2> /dev/null`
|
||||
printf "${ver}"
|
||||
}
|
||||
|
||||
case $ACTION in
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
start)
|
||||
stop
|
||||
start
|
||||
;;
|
||||
status)
|
||||
status
|
||||
;;
|
||||
enable)
|
||||
switch on
|
||||
;;
|
||||
disable)
|
||||
switch off
|
||||
;;
|
||||
version)
|
||||
version
|
||||
;;
|
||||
*)
|
||||
start
|
||||
;;
|
||||
esac
|
||||
Reference in new issue
Block a user