Skip to content

Commit

Permalink
Исправлена ошибка при выводе на экран всех VPN интерфейсов в системе …
Browse files Browse the repository at this point in the history
…(issue qzeleza#74).
  • Loading branch information
qzeleza committed Nov 25, 2023
1 parent c7a86b6 commit 9a94e3d
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 12 deletions.
5 changes: 5 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 1.1.5 final
- В скрипт обновления пакета ipk/update.sh добавлена информация о версии удаляемого пакета.
- Исправлена ошибка при выводе на экран всех VPN интерфейсов в системе (тикет [#74](https://github.com/qzeleza/kvas/issues/74)).
- Теперь при установке пакета в случае наличия файла /opt/etc/hosts.list он не переписывается на файл по умолчанию.

## 1.1.5 pre-release 4
- В скрипт обновления пакета [ipk/update.sh] добавлены дополнительные проверки для корректной его работы.
- Проведена работа над ошибками для блока блокировки рекламы adblock.
Expand Down
4 changes: 2 additions & 2 deletions build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk

PKG_NAME:=kvas
PKG_VERSION:=1.1.5
PKG_RELEASE:=pre_release_4
PKG_RELEASE:=final
PKG_BUILD_DIR:=$(BUILD_DIR)/${FULL_PACKAGE_NAME}_

include $(INCLUDE_DIR)/package.mk
Expand Down Expand Up @@ -69,7 +69,7 @@ chmod -R +x /opt/apps/kvas/etc/ndm/*
ln -sf /opt/apps/kvas/bin/kvas /opt/bin/kvas

cp -f /opt/apps/kvas/etc/conf/kvas.conf /opt/etc/kvas.conf
cp -f /opt/apps/kvas/etc/conf/hosts.list /opt/etc/hosts.list
[ -f /opt/etc/hosts.list ] || cp -f /opt/apps/kvas/etc/conf/hosts.list /opt/etc/hosts.list
cp -f /opt/apps/kvas/etc/conf/adblock.sources /opt/etc/adblock/sources.list
cp -f /opt/apps/kvas/etc/ndm/ndm /opt/apps/kvas/bin/libs/ndm

Expand Down
2 changes: 1 addition & 1 deletion build/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ chmod -R +x /opt/apps/kvas/etc/ndm/*
ln -sf /opt/apps/kvas/bin/kvas /opt/bin/kvas

cp -f /opt/apps/kvas/etc/conf/kvas.conf /opt/etc/kvas.conf
cp -f /opt/apps/kvas/etc/conf/hosts.list /opt/etc/hosts.list
[ -f /opt/etc/hosts.list ] || cp -f /opt/apps/kvas/etc/conf/hosts.list /opt/etc/hosts.list
cp -f /opt/apps/kvas/etc/conf/adblock.sources /opt/etc/adblock/sources.list
cp -f /opt/apps/kvas/etc/ndm/ndm /opt/apps/kvas/bin/libs/ndm

Expand Down
4 changes: 2 additions & 2 deletions build/version
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
VERSION=1.1.5
STAGE=pre_release
RELEASE=4
STAGE=final
RELEASE=
Binary file added ipk/kvas_1.1.5-final_all.ipk
Binary file not shown.
File renamed without changes.
20 changes: 14 additions & 6 deletions opt/bin/libs/vpn
Original file line number Diff line number Diff line change
Expand Up @@ -1846,11 +1846,18 @@ test_host() {
# ------------------------------------------------------------------------------------------

host_add() {
reset="${2}"
clear_host=$(echo "${1}" | sed 's/\*//')
reset="${2}"
mode="${3}"
_host="${clear_host}"

answer=''; read_ynq "Добавить хост с поддоменами wildcard [Y] или нет [N]?" answer
if [ "${mode}" = import ]; then
# в режиме импорта задавать вопросы не нужно - добавляем хост как есть.
answer=n
else
answer=''; read_ynq "Добавить хост с поддоменами wildcard [Y] или нет [N]?" answer
fi


if [ "${answer}" = y ]; then
_host="*${clear_host}"
Expand Down Expand Up @@ -1879,6 +1886,7 @@ host_add() {
#
# ------------------------------------------------------------------------------------------
cmd_add_one_host() {
mode="${4}"
test="${3}"
reset="${2:-yes}"
host=$(echo "${1}" | sed 's|http[s]\{,1\}://||;')
Expand All @@ -1888,7 +1896,7 @@ cmd_add_one_host() {
if echo "${host}" | grep -q '\.' ; then
if echo "${clear_host}" | grep -qE "${ip_filter}*" ; then
if echo "${clear_host}" | grep -qE "^${ip_filter}/[0-9]{1,2}$|^${ip_filter}$|^${ip_filter}-${ip_filter}$"; then
host_add "${host}" "${reset}"
host_add "${host}" "${reset}" "${mode}"
else
echo -e "${RED}Введенный IP адрес или диапазон IP-адресов имеет некорректный формат.${NOCL}"
fi
Expand All @@ -1899,13 +1907,13 @@ cmd_add_one_host() {
warning "Производим замену ${clear_host} на ${host}"
print_line
sed -i "/^${clear_host}$/d" "${UNBLOCK_LIST_FILE}"
host_add "${host}" "${reset}"
host_add "${host}" "${reset}" "${mode}"
else
echo 1
fi
else
if [ -z "${test}" ]; then
host_add "${host}" "${reset}"
host_add "${host}" "${reset}" "${mode}"
else
echo +
fi
Expand Down Expand Up @@ -2034,7 +2042,7 @@ cmd_import_hosts() {
# пропускаем строки с комментариями
[ "${host:0:1}" = "#" ] && continue

case "$(cmd_add_one_host "${host}" "test" "no")" in
case "$(cmd_add_one_host "${host}" "test" "no" "import")" in
0) hosts_not_added="${hosts_not_added}${host}\n" ;;
1) hosts_repeated_bl="${hosts_repeated_bl}${host}\n" ;;
+) hosts_to_add_ubl="${hosts_to_add_ubl}${host}\n" ;;
Expand Down
2 changes: 1 addition & 1 deletion opt/etc/conf/kvas.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
APP_VERSION=1.1.5
APP_RELEASE=pre_release-4
APP_RELEASE=final

DNS_DEFAULT=9.9.9.9
DNS_STATIC_1=9.9.9.9
Expand Down

0 comments on commit 9a94e3d

Please sign in to comment.