Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions hey403/utils/dns_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ def get_current_dns(self) -> str:

elif self.platform == "Linux":
result = subprocess.check_output(
["nmcli", "-t", "-f", "IP4.DNS", "connection", "show", "--active"],
text=True,
)
return result.strip() or "Unknown"
["nmcli", "device", "show"],
text=True
).splitlines()
res = [line[13:].strip() for line in result if line.startswith('IP4.DNS')]
return res[0].strip() or "Unknown"

elif self.platform == "Darwin":
result = subprocess.check_output(
Expand Down
Binary file added packaging/linux/hey403
Binary file not shown.
Binary file added packaging/linux/hey403-linux.tar.gz
Binary file not shown.
37 changes: 37 additions & 0 deletions packaging/linux/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash

# Author: Diramid <diramidteam@gmail.com>
# Version: v1.2.0
# Date: 2025-03-7
# Description: hey403 installation script
# Usage: ./install.sh

GREEN="\e[32m"
YELLOW="\e[33m"
NC="\e[0m"

if [[ $EUID -ne 0 ]]; then
echo -e "${YELLOW}WARNING: You should run this script as the root user.${NC}"
read -t 15 -r -p "Do you want to continue as root? (Y/n): " choice
echo
choice=${choice:-Y}

if [[ ${choice} =~ ^[Yy]$ ]]; then
echo -e "${GREEN}INFO: Running script with root privileges"
sudo "${0}" "$0"
exit 0
else
exit 1
fi

fi

SCRIPT_NAME="hey403"
DEST="/usr/local/bin"

echo -e "${GREEN}INFO: Starting the hey403 installation process...${NC}"
echo -e "${GREEN}INFO: Moving files...${NC}"

sudo cp "${SCRIPT_NAME}" "${DEST}"

echo -e "${GREEN}INFO: Installation completed successfully!${NC}"