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;' }, [
// Podkop Status Panel
createStatusPanel('Podkop Status', podkopStatus, [
podkopStatus.running ?
ButtonFactory.createActionButton({
label: 'Stop Podkop',
type: 'remove',
action: 'stop',
reload: true
}) :
ButtonFactory.createActionButton({
label: 'Start Podkop',
type: 'apply',
action: 'start',
reload: true
}),
ButtonFactory.createActionButton({
label: podkopStatus.running ? 'Stop Podkop' : 'Start Podkop',
type: podkopStatus.running ? 'remove' : 'apply',
action: podkopStatus.running ? 'stop' : 'start',
reload: true
}),
ButtonFactory.createActionButton({
label: 'Restart Podkop',
type: 'apply',

View File

@@ -746,4 +746,7 @@ msgid "not works in browser"
msgstr "не работает в браузере"
msgid "not works on router"
msgstr "не работает на роутере"
msgstr "не работает на роутере"
msgid "Diagnostics"
msgstr "Диагностика"

View File

@@ -1100,4 +1100,7 @@ msgid "not works in browser"
msgstr ""
msgid "not works on router"
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}"
}
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
start)
start
@@ -1976,6 +1988,12 @@ case "$1" in
stop
start
;;
enable)
enable
;;
disable)
disable
;;
main)
main
;;