🐤 Sync 2023-10-01 23:35:47

This commit is contained in:
github-actions[bot] 2023-10-01 23:35:47 +08:00
parent 8658ca561a
commit 1bc85961c6
5 changed files with 14 additions and 16 deletions

View File

@ -1,8 +1,8 @@
# Copyright (C) 2020-2021 Hyy2001X <https://github.com/Hyy2001X>
# Copyright (C) 2020-2023 Hyy2001X <https://github.com/Hyy2001X>
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI support for iPerf3
LUCI_TITLE:=LuCI support for iPerf3 server
LUCI_DEPENDS:=+iperf3
LUCI_PKGARCH:=all

View File

@ -1,11 +1,9 @@
#!/bin/sh /etc/rc.common
START=99
USE_PROCD=1
LOGGER="logger -t [iPerf3-Server]"
start_service() {
stop_service
start() {
local basic_list="main_enable"
local server_list="port delay extra_options enable_server"
for i in $(echo $basic_list)
@ -18,7 +16,6 @@ start_service() {
# server_number=$(uci show iperf3-server 2> /dev/null | egrep -o '@servers\[[0-9]\]+=servers' | awk 'END {print}' | egrep -o "[0-9]")
for u in $(seq 0 $((${server_number} - 1)))
do
{
for i in $server_list
do
eval ${i}=$(uci_get_by_type servers $u $i)
@ -27,14 +24,15 @@ start_service() {
then
sleep $delay
$LOGGER "Starting iPerf3 Server [$u] with Port [$port] ..."
# $(command -v iperf3) -s -D -p $port $extra_options
procd_open_instance
procd_set_param command sleep $delay ; $(command -v iperf3) -s -D -p $port $extra_options
procd_set_param respawn 3000 3 10
procd_close_instance
old_process="$(ps -efww | grep 'iperf3 -s -D -p $port' | grep -v 'grep' | awk '{print $1}')"
[ "$old_process" ] && kill -9 "$old_process" 2> /dev/null
$(command -v iperf3) -s -D -p $port $extra_options
#procd_open_instance
#procd_set_param command sleep $delay ; $(command -v iperf3) -s -D -p $port $extra_options
#procd_set_param respawn 3000 3 10
#procd_close_instance
fi
unset enable_server delay
} &
done ; unset u
else
$LOGGER "iPerf3 Server is disabled ..."
@ -42,7 +40,7 @@ start_service() {
fi
}
stop_service() {
stop() {
$LOGGER "Stopping iPerf3 Server ..."
ps -efww | grep 'iperf3 -s -D' | grep -v 'grep' | awk '{print $1}' | xargs kill -9
}

View File

@ -29,6 +29,6 @@
return false;
}
//]]></script>
<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Flush Cache%>" onclick="return flush_cache(this,'<%=self.option%>')" />
<input type="button" class="btn cbi-button-action" value="<%:Flush Cache%>" onclick="return flush_cache(this,'<%=self.option%>')" />
<span id="<%=self.option%>-status"><em><%=self.value%></em></span>
<%+cbi/valuefooter%>

View File

@ -29,6 +29,6 @@
return false;
}
//]]></script>
<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Check And Update%>" onclick="return update_data(this,'<%=self.option%>')" />
<input type="button" class="btn cbi-button-action" value="<%:Check And Update%>" onclick="return update_data(this,'<%=self.option%>')" />
<span id="<%=self.option%>-status"><em><%=self.value%></em></span>
<%+cbi/valuefooter%>

View File

@ -28,6 +28,6 @@
//]]>
</script>
<fieldset class="cbi-section" id="_log_fieldset">
<input class="cbi-button cbi-input-remove" type="button" onclick="clear_log()" value="<%:Clear logs%>" style="margin-left: 10px; margin-top: 10px;">
<input class="btn cbi-button-action" type="button" onclick="clear_log()" value="<%:Clear logs%>" style="margin-left: 10px; margin-top: 10px;">
<textarea id="log_textarea" class="cbi-input-textarea" style="width: calc(100% - 20px); height: 645px; margin: 10px;" data-update="change" rows="5" wrap="off" readonly="readonly"></textarea>
</fieldset>