mirror of
https://github.com/itdoginfo/podkop.git
synced 2025-12-06 19:46:52 +03:00
Compare commits
6 Commits
0.7.8
...
64369a93b0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
64369a93b0 | ||
|
|
53a3c943f0 | ||
|
|
7c7e1c6244 | ||
|
|
7fc1f39dd6 | ||
|
|
1c4285dfa8 | ||
|
|
ea1273e05e |
20
install.sh
20
install.sh
@@ -109,16 +109,16 @@ main() {
|
|||||||
pkg_list_update || { echo "Packages list update failed"; exit 1; }
|
pkg_list_update || { echo "Packages list update failed"; exit 1; }
|
||||||
|
|
||||||
if [ -f "/etc/init.d/podkop" ]; then
|
if [ -f "/etc/init.d/podkop" ]; then
|
||||||
msg "Podkop is already installed. Upgraded..."
|
msg "Podkop is already installed. Upgrading..."
|
||||||
else
|
else
|
||||||
msg "Installed podkop..."
|
msg "Installing podkop..."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if command -v curl >/dev/null 2>&1; then
|
if command -v curl >/dev/null 2>&1; then
|
||||||
check_response=$(curl -s "https://api.github.com/repos/itdoginfo/podkop/releases/latest")
|
check_response=$(curl -s "https://api.github.com/repos/itdoginfo/podkop/releases/latest")
|
||||||
|
|
||||||
if echo "$check_response" | grep -q 'API rate limit '; then
|
if echo "$check_response" | grep -q 'API rate limit '; then
|
||||||
msg "You've reached rate limit from GitHub. Repeat in five minutes."
|
msg "You've reached the GitHub rate limit. Repeat in five minutes."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@@ -143,7 +143,7 @@ main() {
|
|||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
msg "Download error $filename. Retry..."
|
msg "Download error for $filename. Retrying..."
|
||||||
rm -f "$filepath"
|
rm -f "$filepath"
|
||||||
attempt=$((attempt+1))
|
attempt=$((attempt+1))
|
||||||
done
|
done
|
||||||
@@ -168,7 +168,7 @@ main() {
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
if [ -n "$file" ]; then
|
if [ -n "$file" ]; then
|
||||||
msg "Installing $file"
|
msg "Installing $file..."
|
||||||
pkg_install "$DOWNLOAD_DIR/$file"
|
pkg_install "$DOWNLOAD_DIR/$file"
|
||||||
sleep 3
|
sleep 3
|
||||||
fi
|
fi
|
||||||
@@ -183,11 +183,11 @@ main() {
|
|||||||
done
|
done
|
||||||
if [ -n "$ru" ]; then
|
if [ -n "$ru" ]; then
|
||||||
if pkg_is_installed luci-i18n-podkop-ru; then
|
if pkg_is_installed luci-i18n-podkop-ru; then
|
||||||
msg "Upgraded ru translation..."
|
msg "Upgrading Russian translation..."
|
||||||
pkg_remove luci-i18n-podkop*
|
pkg_remove luci-i18n-podkop*
|
||||||
pkg_install "$DOWNLOAD_DIR/$ru"
|
pkg_install "$DOWNLOAD_DIR/$ru"
|
||||||
else
|
else
|
||||||
msg "Русский язык интерфейса ставим? y/n (Need a Russian translation?)"
|
msg "Русский язык интерфейса ставим? y/n (Install the Russian interface language?)"
|
||||||
while true; do
|
while true; do
|
||||||
read -r -p '' RUS
|
read -r -p '' RUS
|
||||||
case $RUS in
|
case $RUS in
|
||||||
@@ -236,7 +236,7 @@ check_system() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if ! nslookup google.com >/dev/null 2>&1; then
|
if ! nslookup google.com >/dev/null 2>&1; then
|
||||||
msg "DNS not working"
|
msg "DNS is not working."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -270,7 +270,7 @@ check_system() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if pkg_is_installed https-dns-proxy; then
|
if pkg_is_installed https-dns-proxy; then
|
||||||
msg "Сonflicting package detected: https-dns-proxy. Remove?"
|
msg "Conflicting package detected: https-dns-proxy. Remove?"
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
read -r -p '' DNSPROXY
|
read -r -p '' DNSPROXY
|
||||||
@@ -300,7 +300,7 @@ sing_box() {
|
|||||||
required_version="1.12.4"
|
required_version="1.12.4"
|
||||||
|
|
||||||
if [ "$(printf '%s\n%s\n' "$sing_box_version" "$required_version" | sort -V | head -n 1)" != "$required_version" ]; then
|
if [ "$(printf '%s\n%s\n' "$sing_box_version" "$required_version" | sort -V | head -n 1)" != "$required_version" ]; then
|
||||||
msg "sing-box version $sing_box_version is older than required $required_version"
|
msg "sing-box version $sing_box_version is older than the required version $required_version."
|
||||||
msg "Removing old version..."
|
msg "Removing old version..."
|
||||||
service podkop stop
|
service podkop stop
|
||||||
pkg_remove sing-box
|
pkg_remove sing-box
|
||||||
|
|||||||
@@ -282,8 +282,6 @@ create_nft_rules() {
|
|||||||
log "Create nft table"
|
log "Create nft table"
|
||||||
nft_create_table "$NFT_TABLE_NAME"
|
nft_create_table "$NFT_TABLE_NAME"
|
||||||
|
|
||||||
nft_init_interfaces_set
|
|
||||||
|
|
||||||
log "Create localv4 set"
|
log "Create localv4 set"
|
||||||
nft_create_ipv4_set "$NFT_TABLE_NAME" "$NFT_LOCALV4_SET_NAME"
|
nft_create_ipv4_set "$NFT_TABLE_NAME" "$NFT_LOCALV4_SET_NAME"
|
||||||
nft add element inet "$NFT_TABLE_NAME" localv4 '{
|
nft add element inet "$NFT_TABLE_NAME" localv4 '{
|
||||||
@@ -325,7 +323,7 @@ create_nft_rules() {
|
|||||||
nft add rule inet "$NFT_TABLE_NAME" mangle_output ip daddr "@$NFT_COMMON_SET_NAME" meta l4proto tcp meta mark set 0x105 counter
|
nft add rule inet "$NFT_TABLE_NAME" mangle_output ip daddr "@$NFT_COMMON_SET_NAME" meta l4proto tcp meta mark set 0x105 counter
|
||||||
nft add rule inet "$NFT_TABLE_NAME" mangle_output ip daddr "@$NFT_COMMON_SET_NAME" meta l4proto udp meta mark set 0x105 counter
|
nft add rule inet "$NFT_TABLE_NAME" mangle_output ip daddr "@$NFT_COMMON_SET_NAME" meta l4proto udp meta mark set 0x105 counter
|
||||||
nft add rule inet "$NFT_TABLE_NAME" mangle_output ip daddr "$SB_FAKEIP_INET4_RANGE" meta l4proto tcp meta mark set 0x105 counter
|
nft add rule inet "$NFT_TABLE_NAME" mangle_output ip daddr "$SB_FAKEIP_INET4_RANGE" meta l4proto tcp meta mark set 0x105 counter
|
||||||
nft add rule inet "$NFT_TABLE_NAME" mangle_output ip daddr "$SB_FAKEIP_INET4_RANGE" meta l4proto tcp meta mark set 0x105 counter
|
nft add rule inet "$NFT_TABLE_NAME" mangle_output ip daddr "$SB_FAKEIP_INET4_RANGE" meta l4proto udp meta mark set 0x105 counter
|
||||||
|
|
||||||
local exclude_ntp
|
local exclude_ntp
|
||||||
config_get_bool exclude_ntp "settings" "exclude_ntp" "0"
|
config_get_bool exclude_ntp "settings" "exclude_ntp" "0"
|
||||||
@@ -1507,12 +1505,15 @@ section_has_enabled_lists() {
|
|||||||
get_service_listen_address() {
|
get_service_listen_address() {
|
||||||
local service_listen_address
|
local service_listen_address
|
||||||
|
|
||||||
service_listen_address="$(uci_get "network" "lan" "ipaddr")"
|
config_get service_listen_address "settings" "service_listen_address"
|
||||||
|
if [ -n "$service_listen_address" ]; then
|
||||||
if [ -z "$service_listen_address" ]; then
|
log "Attention! The service_listen_address option is being used, overriding the automatic detection of the listening IP address!" "warn"
|
||||||
config_get service_listen_address "settings" "service_listen_address" # TODO(ampetelin): Remove after testing
|
echo "$service_listen_address"
|
||||||
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
service_listen_address="$(uci_get "network" "lan" "ipaddr" | awk '{print $1}' | cut -d'/' -f1)"
|
||||||
|
|
||||||
if [ -z "$service_listen_address" ]; then
|
if [ -z "$service_listen_address" ]; then
|
||||||
log "Failed to determine the listening IP address. Please open an issue to report this problem: https://github.com/itdoginfo/podkop/issues" "error"
|
log "Failed to determine the listening IP address. Please open an issue to report this problem: https://github.com/itdoginfo/podkop/issues" "error"
|
||||||
return 1
|
return 1
|
||||||
|
|||||||
Reference in New Issue
Block a user