diff --git a/podkop/Makefile b/podkop/Makefile index d5c7d66..bacb7c1 100644 --- a/podkop/Makefile +++ b/podkop/Makefile @@ -48,7 +48,6 @@ endef define Package/podkop/install $(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_BIN) ./files/etc/init.d/podkop $(1)/etc/init.d/podkop - sed -i "s/VERSION_FROM_MAKEFILE/$(PKG_VERSION)/g" $(1)/etc/init.d/podkop $(INSTALL_DIR) $(1)/etc/config $(INSTALL_CONF) ./files/etc/config/podkop $(1)/etc/config/podkop @@ -58,6 +57,8 @@ define Package/podkop/install $(INSTALL_DIR) $(1)/usr/lib/podkop $(CP) ./files/usr/lib/* $(1)/usr/lib/podkop/ + + sed -i -e 's/__COMPILED_VERSION_VARIABLE__/$(PKG_VERSION)/g' $(1)/usr/lib/podkop/constants.sh endef $(eval $(call BuildPackage,podkop)) diff --git a/podkop/files/usr/bin/podkop b/podkop/files/usr/bin/podkop index 15c671c..847e1b2 100755 --- a/podkop/files/usr/bin/podkop +++ b/podkop/files/usr/bin/podkop @@ -1784,13 +1784,7 @@ show_config() { } show_version() { - local version=$(opkg list-installed podkop | awk '{print $3}') - echo "$version" -} - -show_luci_version() { - local version=$(opkg list-installed luci-app-podkop | awk '{print $3}') - echo "$version" + echo "$PODKOP_VERSION" } show_sing_box_version() { @@ -1967,11 +1961,14 @@ find_working_resolver() { } global_check() { + local PODKOP_LUCI_VERSION="Unknown" + [ -n "$1" ] && PODKOP_LUCI_VERSION="$1" + print_global "📡 Global check run!" print_global "━━━━━━━━━━━━━━━━━━━━━━━━━━━" print_global "🛠️ System info" - print_global "🕳️ Podkop: $(opkg list-installed podkop | awk '{print $3}')" - print_global "🕳️ LuCI App: $(opkg list-installed luci-app-podkop | awk '{print $3}')" + print_global "🕳️ Podkop: ${PODKOP_VERSION}" + print_global "🕳️ LuCI App: ${PODKOP_LUCI_VERSION}" print_global "📦 Sing-box: $(sing-box version | head -n 1 | awk '{print $3}')" print_global "🛜 OpenWrt: $(grep OPENWRT_RELEASE /etc/os-release | cut -d'"' -f2)" print_global "🛜 Device: $(cat /tmp/sysinfo/model)" @@ -2133,7 +2130,6 @@ Available commands: show_config Display current podkop configuration show_version Show podkop version show_sing_box_config Show sing-box configuration - show_luci_version Show LuCI app version show_sing_box_version Show sing-box version show_system_info Show system information get_status Get podkop service status @@ -2192,9 +2188,6 @@ show_version) show_sing_box_config) show_sing_box_config ;; -show_luci_version) - show_luci_version - ;; show_sing_box_version) show_sing_box_version ;; @@ -2211,10 +2204,10 @@ check_dns_available) check_dns_available ;; global_check) - global_check + global_check "${2:-}" ;; *) show_help exit 1 ;; -esac +esac \ No newline at end of file diff --git a/podkop/files/usr/lib/constants.sh b/podkop/files/usr/lib/constants.sh index 4745434..42e4156 100644 --- a/podkop/files/usr/lib/constants.sh +++ b/podkop/files/usr/lib/constants.sh @@ -1,5 +1,6 @@ # shellcheck disable=SC2034 +PODKOP_VERSION="__COMPILED_VERSION_VARIABLE__" ## Common PODKOP_CONFIG="/etc/config/podkop" RESOLV_CONF="/etc/resolv.conf"