Load SNI From env

This commit is contained in:
ReturnFI
2024-09-05 13:58:45 +00:00
parent ff07e14d98
commit 20e99e3575
4 changed files with 16 additions and 11 deletions

View File

@ -9,11 +9,9 @@ define_colors() {
NC='\033[0m' # No Color
}
# Function to get system information
get_system_info() {
OS=$(lsb_release -d | awk -F'\t' '{print $2}')
ARCH=$(uname -m)
# Fetching detailed IP information in JSON format
IP_API_DATA=$(curl -s https://ipapi.co/json/ -4)
ISP=$(echo "$IP_API_DATA" | jq -r '.org')
IP=$(echo "$IP_API_DATA" | jq -r '.ip')
@ -53,3 +51,13 @@ check_version() {
echo -e "${cyan}Bug squashing party!${yellow} Update for the best invitation.${NC}"
fi
}
load_hysteria2_env() {
if [ -f /etc/hysteria/hysteria2.env ]; then
export $(grep -v '^#' /etc/hysteria/hysteria2.env | xargs)
else
echo "Error: hysteria2.env file not found. Using default SNI 'bts.com'."
SNI="bts.com"
fi
}