fix: fix enable/disable functionality to podkop service

This commit is contained in:
Ivan K
2025-03-13 10:00:37 +03:00
parent 23203fd7a1
commit 1263b9b1b8
4 changed files with 31 additions and 14 deletions

View File

@@ -677,19 +677,12 @@ let createStatusSection = function (podkopStatus, singboxStatus, podkop, luci, s
E('div', { 'class': 'table', style: 'display: flex; gap: 20px;' }, [ E('div', { 'class': 'table', style: 'display: flex; gap: 20px;' }, [
// Podkop Status Panel // Podkop Status Panel
createStatusPanel('Podkop Status', podkopStatus, [ createStatusPanel('Podkop Status', podkopStatus, [
podkopStatus.running ? ButtonFactory.createActionButton({
ButtonFactory.createActionButton({ label: podkopStatus.running ? 'Stop Podkop' : 'Start Podkop',
label: 'Stop Podkop', type: podkopStatus.running ? 'remove' : 'apply',
type: 'remove', action: podkopStatus.running ? 'stop' : 'start',
action: 'stop', reload: true
reload: true }),
}) :
ButtonFactory.createActionButton({
label: 'Start Podkop',
type: 'apply',
action: 'start',
reload: true
}),
ButtonFactory.createActionButton({ ButtonFactory.createActionButton({
label: 'Restart Podkop', label: 'Restart Podkop',
type: 'apply', type: 'apply',

View File

@@ -747,3 +747,6 @@ msgstr "не работает в браузере"
msgid "not works on router" msgid "not works on router"
msgstr "не работает на роутере" msgstr "не работает на роутере"
msgid "Diagnostics"
msgstr "Диагностика"

View File

@@ -1101,3 +1101,6 @@ msgstr ""
msgid "not works on router" msgid "not works on router"
msgstr "" msgstr ""
msgid "Diagnostics"
msgstr ""

View File

@@ -1965,6 +1965,18 @@ sing_box_add_secure_dns_probe_domain() {
log "DNS probe domain ${domain} configured with override to port ${override_port}" log "DNS probe domain ${domain} configured with override to port ${override_port}"
} }
enable() {
log "Enabling podkop service"
/etc/init.d/podkop enable
log "Podkop service enabled"
}
disable() {
log "Disabling podkop service"
/etc/init.d/podkop disable
log "Podkop service disabled"
}
case "$1" in case "$1" in
start) start)
start start
@@ -1976,6 +1988,12 @@ case "$1" in
stop stop
start start
;; ;;
enable)
enable
;;
disable)
disable
;;
main) main)
main main
;; ;;