mirror of
https://github.com/itdoginfo/podkop.git
synced 2025-12-06 03:26:51 +03:00
Compare commits
3 Commits
7a497f1e31
...
14f704fcb8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
14f704fcb8 | ||
|
|
ff43f477e9 | ||
|
|
576e58fd17 |
@@ -104,7 +104,7 @@ has_outbound_section() {
|
||||
return $section_exists
|
||||
}
|
||||
|
||||
start() {
|
||||
start_main() {
|
||||
log "Starting podkop"
|
||||
|
||||
check_requirements
|
||||
@@ -133,23 +133,16 @@ start() {
|
||||
config_foreach add_cron_job "section"
|
||||
/etc/init.d/sing-box start
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Failed to start sing-box service"
|
||||
echolog "Failed to start sing-box service"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
config_get_bool dont_touch_dhcp "settings" "dont_touch_dhcp" 0
|
||||
if [ "$dont_touch_dhcp" -eq 0 ]; then
|
||||
dnsmasq_configure
|
||||
fi
|
||||
uci_set "podkop" "settings" "shutdown_correctly" 0
|
||||
uci commit "podkop" && config_load "$PODKOP_CONFIG"
|
||||
|
||||
log "Nice"
|
||||
list_update &
|
||||
echo $! > /var/run/podkop_list_update.pid
|
||||
}
|
||||
|
||||
stop() {
|
||||
stop_main() {
|
||||
log "Stopping the podkop"
|
||||
|
||||
if [ -f /var/run/podkop_list_update.pid ]; then
|
||||
@@ -180,14 +173,30 @@ stop() {
|
||||
ip route flush table podkop
|
||||
fi
|
||||
|
||||
log "Stop sing-box"
|
||||
/etc/init.d/sing-box stop
|
||||
}
|
||||
|
||||
start() {
|
||||
start_main
|
||||
|
||||
config_get_bool dont_touch_dhcp "settings" "dont_touch_dhcp" 0
|
||||
if [ "$dont_touch_dhcp" -eq 0 ]; then
|
||||
dnsmasq_configure
|
||||
fi
|
||||
|
||||
uci_set "podkop" "settings" "shutdown_correctly" 0
|
||||
uci commit "podkop" && config_load "$PODKOP_CONFIG"
|
||||
}
|
||||
|
||||
stop() {
|
||||
local dont_touch_dhcp
|
||||
config_get_bool dont_touch_dhcp "settings" "dont_touch_dhcp" 0
|
||||
if [ "$dont_touch_dhcp" -eq 0 ]; then
|
||||
dnsmasq_restore
|
||||
fi
|
||||
|
||||
log "Stop sing-box"
|
||||
/etc/init.d/sing-box stop
|
||||
stop_main
|
||||
|
||||
uci_set "podkop" "settings" "shutdown_correctly" 1
|
||||
uci commit "podkop" && config_load "$PODKOP_CONFIG"
|
||||
@@ -195,8 +204,8 @@ stop() {
|
||||
|
||||
reload() {
|
||||
log "Podkop reload"
|
||||
stop
|
||||
start
|
||||
stop_main
|
||||
start_main
|
||||
}
|
||||
|
||||
restart() {
|
||||
|
||||
Reference in New Issue
Block a user