Skip to content

Commit

Permalink
Попытка решить проблемы с отсутствием обхода при переподключением VPN…
Browse files Browse the repository at this point in the history
… (тикеты #45 и #73)
  • Loading branch information
qzeleza committed Sep 25, 2023
1 parent 5551247 commit dc7a213
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
5 changes: 2 additions & 3 deletions ipk/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ list_backup=/opt/etc/hosts.list.backup


print_line
echo "${GREEN}Начинаем установку пакета КВАС${NOCL}"
print_line

ready "${GREEN}Начинаем установку пакета КВАС${NOCL}"
echo
mkdir -p /opt/packages
cd /opt/packages || {
echo "Невозможно создать папку /opt/packages";
Expand Down
Binary file modified ipk/kvas_all.ipk
Binary file not shown.
27 changes: 20 additions & 7 deletions opt/etc/ndm/ifstatechanged.d/100-unblock-vpn
Original file line number Diff line number Diff line change
@@ -1,20 +1,33 @@
#!/bin/sh

link_up(){
ip4set_create_table
ip4_add_route_table
ip4_rule_set_priority
ip4_mark_vpn_network
}

link_down(){
ip4_firewall_flush_vpn_rules
ip4_rule_del_priority
ip4_flush_all_tables
}

link_reboot(){
link_down
link_up
}

if [ "${1}" = "hook" ] && [ "${change}" = "link" ] ; then
. /opt/apps/kvas/bin/libs/ndm
if [ "${id}" = "$(inface_cli)" ]; then
# logger -t "КВАС" "Запущен файл ${0} [${id}-${change}-${connected}-${link}-${up}]"
case "${id}-${change}-${connected}-${link}-${up}" in
"${id}-link-no-down-down" )
ip4_firewall_flush_vpn_rules &>/dev/null
ip4_rule_del_priority &>/dev/null
ip4_flush_all_tables &>/dev/null
link_reboot &> /dev/null
;;
"${id}-link-yes-up-up" )
ip4set_create_table &>/dev/null
ip4_add_route_table &> /dev/null
ip4_rule_set_priority &> /dev/null
ip4_mark_vpn_network &> /dev/null
link_up &> /dev/null
;;
esac
fi
Expand Down

0 comments on commit dc7a213

Please sign in to comment.