diff --git a/core/scripts/hysteria2/show_user_uri.sh b/core/scripts/hysteria2/show_user_uri.sh index c27ba4e..5333468 100644 --- a/core/scripts/hysteria2/show_user_uri.sh +++ b/core/scripts/hysteria2/show_user_uri.sh @@ -122,13 +122,13 @@ show_uri() { fi fi - if [ "$generate_singbox" = true ] && systemctl is-active --quiet singbox.service; then + if [ "$generate_singbox" = true ] && systemctl is-active --quiet hysteria-singbox.service; then read -r domain port < <(get_singbox_domain_and_port) if [ -n "$domain" ] && [ -n "$port" ]; then echo -e "\nSingbox Sublink:\nhttps://$domain:$port/sub/singbox/$username/$ip_version#$username\n" fi fi - if [ "$generate_normalsub" = true ] && systemctl is-active --quiet normalsub.service; then + if [ "$generate_normalsub" = true ] && systemctl is-active --quiet hysteria-normal-sub.service; then read -r domain port < <(get_normalsub_domain_and_port) if [ -n "$domain" ] && [ -n "$port" ]; then echo -e "\nNormal-SUB Sublink:\nhttps://$domain:$port/sub/normal/$username#Hysteria2\n" diff --git a/core/scripts/hysteria2/uninstall.sh b/core/scripts/hysteria2/uninstall.sh index 1528294..04c1c45 100644 --- a/core/scripts/hysteria2/uninstall.sh +++ b/core/scripts/hysteria2/uninstall.sh @@ -32,12 +32,12 @@ echo "Removing alias 'hys2' from .bashrc..." sed -i '/alias hys2=.*\/etc\/hysteria\/menu.sh/d' ~/.bashrc echo "Stop/Disabling Hysteria TelegramBOT Service..." -systemctl stop hysteria-bot.service > /dev/null 2>&1 -systemctl disable hysteria-bot.service > /dev/null 2>&1 +systemctl stop hysteria-telegram-bot.service > /dev/null 2>&1 +systemctl disable hysteria-telegram-bot.service > /dev/null 2>&1 echo "Stop/Disabling Singbox SubLink Service..." -systemctl stop singbox.service > /dev/null 2>&1 -systemctl disable singbox.service > /dev/null 2>&1 +systemctl stop hysteria-singbox.service > /dev/null 2>&1 +systemctl disable hysteria-singbox.service > /dev/null 2>&1 echo "Hysteria2 uninstalled!" diff --git a/core/scripts/normalsub/normalsub.sh b/core/scripts/normalsub/normalsub.sh index 8f39067..489f4df 100644 --- a/core/scripts/normalsub/normalsub.sh +++ b/core/scripts/normalsub/normalsub.sh @@ -26,7 +26,7 @@ EOL } create_service_file() { - cat < /etc/systemd/system/normalsub.service + cat < /etc/systemd/system/hysteria-normal-sub.service [Unit] Description=normalsub Python Service After=network.target @@ -48,8 +48,8 @@ start_service() { local domain=$1 local port=$2 - if systemctl is-active --quiet normalsub.service; then - echo "The normalsub.service is already running." + if systemctl is-active --quiet hysteria-normal-sub.service; then + echo "The hysteria-normal-sub.service is already running." return fi @@ -67,11 +67,11 @@ start_service() { chown -R hysteria:hysteria "/etc/letsencrypt/live/$domain" chown -R hysteria:hysteria /etc/hysteria/core/scripts/normalsub systemctl daemon-reload - systemctl enable normalsub.service > /dev/null 2>&1 - systemctl start normalsub.service > /dev/null 2>&1 + systemctl enable hysteria-normal-sub.service > /dev/null 2>&1 + systemctl start hysteria-normal-sub.service > /dev/null 2>&1 systemctl daemon-reload > /dev/null 2>&1 - if systemctl is-active --quiet normalsub.service; then + if systemctl is-active --quiet hysteria-normal-sub.service; then echo -e "${green}normalsub service setup completed. The service is now running on port $port. ${NC}" else echo -e "${red}normalsub setup completed. The service failed to start. ${NC}" @@ -90,8 +90,8 @@ stop_service() { echo -e "${red}HYSTERIA_DOMAIN not found in .env. Skipping certificate deletion.${NC}" fi - systemctl stop normalsub.service > /dev/null 2>&1 - systemctl disable normalsub.service > /dev/null 2>&1 + systemctl stop hysteria-normal-sub.service > /dev/null 2>&1 + systemctl disable hysteria-normal-sub.service > /dev/null 2>&1 systemctl daemon-reload > /dev/null 2>&1 rm -f /etc/hysteria/core/scripts/normalsub/.env diff --git a/core/scripts/services_status.sh b/core/scripts/services_status.sh index eaf42fb..01e6325 100644 --- a/core/scripts/services_status.sh +++ b/core/scripts/services_status.sh @@ -3,9 +3,9 @@ declare -a services=( "hysteria-server.service" "webpanel.service" - "hysteria-bot.service" - "normalsub.service" - "singbox.service" + "hysteria-telegram-bot.service" + "hysteria-normal-sub.service" + "hysteria-singbox.service" "wg-quick@wgcf.service" ) diff --git a/core/scripts/singbox/singbox_shell.sh b/core/scripts/singbox/singbox_shell.sh index 337fe22..f22de6c 100644 --- a/core/scripts/singbox/singbox_shell.sh +++ b/core/scripts/singbox/singbox_shell.sh @@ -26,7 +26,7 @@ EOL } create_service_file() { - cat < /etc/systemd/system/singbox.service + cat < /etc/systemd/system/hysteria-singbox.service [Unit] Description=Singbox Python Service After=network.target @@ -48,8 +48,8 @@ start_service() { local domain=$1 local port=$2 - if systemctl is-active --quiet singbox.service; then - echo "The singbox.service is already running." + if systemctl is-active --quiet hysteria-singbox.service; then + echo "The hysteria-singbox.service is already running." return fi @@ -67,11 +67,11 @@ start_service() { chown -R hysteria:hysteria "/etc/letsencrypt/live/$domain" chown -R hysteria:hysteria /etc/hysteria/core/scripts/singbox systemctl daemon-reload - systemctl enable singbox.service > /dev/null 2>&1 - systemctl start singbox.service > /dev/null 2>&1 + systemctl enable hysteria-singbox.service > /dev/null 2>&1 + systemctl start hysteria-singbox.service > /dev/null 2>&1 systemctl daemon-reload > /dev/null 2>&1 - if systemctl is-active --quiet singbox.service; then + if systemctl is-active --quiet hysteria-singbox.service; then echo -e "${green}Singbox service setup completed. The service is now running on port $port. ${NC}" else echo -e "${red}Singbox setup completed. The service failed to start. ${NC}" @@ -90,8 +90,8 @@ stop_service() { echo -e "${red}HYSTERIA_DOMAIN not found in .env. Skipping certificate deletion.${NC}" fi - systemctl stop singbox.service > /dev/null 2>&1 - systemctl disable singbox.service > /dev/null 2>&1 + systemctl stop hysteria-singbox.service > /dev/null 2>&1 + systemctl disable hysteria-singbox.service > /dev/null 2>&1 systemctl daemon-reload > /dev/null 2>&1 rm -f /etc/hysteria/core/scripts/singbox/.env diff --git a/core/scripts/telegrambot/runbot.sh b/core/scripts/telegrambot/runbot.sh index 60a63ee..f68396b 100644 --- a/core/scripts/telegrambot/runbot.sh +++ b/core/scripts/telegrambot/runbot.sh @@ -13,7 +13,7 @@ EOL } create_service_file() { - cat < /etc/systemd/system/hysteria-bot.service + cat < /etc/systemd/system/hysteria-telegram-bot.service [Unit] Description=Hysteria Telegram Bot After=network.target @@ -32,8 +32,8 @@ start_service() { local api_token=$1 local admin_user_ids=$2 - if systemctl is-active --quiet hysteria-bot.service; then - echo "The hysteria-bot.service is already running." + if systemctl is-active --quiet hysteria-telegram-bot.service; then + echo "The hysteria-telegram-bot.service is already running." return fi @@ -41,10 +41,10 @@ start_service() { create_service_file systemctl daemon-reload - systemctl enable hysteria-bot.service > /dev/null 2>&1 - systemctl start hysteria-bot.service > /dev/null 2>&1 + systemctl enable hysteria-telegram-bot.service > /dev/null 2>&1 + systemctl start hysteria-telegram-bot.service > /dev/null 2>&1 - if systemctl is-active --quiet hysteria-bot.service; then + if systemctl is-active --quiet hysteria-telegram-bot.service; then echo -e "${green}Hysteria bot setup completed. The service is now running. ${NC}" echo -e "\n\n" else @@ -53,8 +53,8 @@ start_service() { } stop_service() { - systemctl stop hysteria-bot.service > /dev/null 2>&1 - systemctl disable hysteria-bot.service > /dev/null 2>&1 + systemctl stop hysteria-telegram-bot.service > /dev/null 2>&1 + systemctl disable hysteria-telegram-bot.service > /dev/null 2>&1 rm -f /etc/hysteria/core/scripts/telegrambot/.env echo -e "\n" diff --git a/core/scripts/webpanel/webpanel_shell.sh b/core/scripts/webpanel/webpanel_shell.sh index 25fce29..69ff306 100644 --- a/core/scripts/webpanel/webpanel_shell.sh +++ b/core/scripts/webpanel/webpanel_shell.sh @@ -97,7 +97,7 @@ EOL create_webpanel_service_file() { - cat < /etc/systemd/system/webpanel.service + cat < /etc/systemd/system/hysteria-webpanel.service [Unit] Description=Hysteria2 Web Panel After=network.target @@ -125,7 +125,7 @@ start_service() { # MAYBE I WANT TO CHANGE CONFIGS WITHOUT RESTARTING THE SERVICE MYSELF # # Check if the services are already active - # if systemctl is-active --quiet webpanel.service && systemctl is-active --quiet caddy.service; then + # if systemctl is-active --quiet hysteria-webpanel.service && systemctl is-active --quiet caddy.service; then # echo -e "${green}Hysteria web panel is already running with Caddy.${NC}" # source /etc/hysteria/core/scripts/webpanel/.env # echo -e "${yellow}The web panel is accessible at: http://$domain:$port/$ROOT_PATH${NC}" @@ -151,11 +151,11 @@ start_service() { # Reload systemd and enable webpanel service systemctl daemon-reload - systemctl enable webpanel.service > /dev/null 2>&1 - systemctl start webpanel.service > /dev/null 2>&1 + systemctl enable hysteria-webpanel.service > /dev/null 2>&1 + systemctl start hysteria-webpanel.service > /dev/null 2>&1 # Check if the web panel is running - if systemctl is-active --quiet webpanel.service; then + if systemctl is-active --quiet hysteria-webpanel.service; then echo -e "${green}Hysteria web panel setup completed. The web panel is running locally on: http://127.0.0.1:8080/${NC}" else echo -e "${red}Error: Hysteria web panel service failed to start.${NC}" @@ -177,7 +177,7 @@ start_service() { fi # Check if the web panel is still running after Caddy restart - if systemctl is-active --quiet webpanel.service; then + if systemctl is-active --quiet hysteria-webpanel.service; then source /etc/hysteria/core/scripts/webpanel/.env local webpanel_url="http://$domain:$port/$ROOT_PATH/" echo -e "${green}Hysteria web panel is now running. The service is accessible on: $webpanel_url ${NC}" @@ -204,8 +204,8 @@ stop_service() { echo "Caddy stopped." echo "Stopping Hysteria web panel..." - systemctl disable webpanel.service - systemctl stop webpanel.service + systemctl disable hysteria-webpanel.service + systemctl stop hysteria-webpanel.service echo "Hysteria web panel stopped." } diff --git a/menu.sh b/menu.sh index 70dd7b6..3e37e9e 100644 --- a/menu.sh +++ b/menu.sh @@ -259,11 +259,11 @@ hysteria2_show_user_uri_handler() { flags="" - if check_service_active "singbox.service"; then + if check_service_active "hysteria-singbox.service"; then flags+=" -s" fi - if check_service_active "normalsub.service"; then + if check_service_active "hysteria-normal-sub.service"; then flags+=" -n" fi @@ -300,8 +300,8 @@ hysteria2_change_sni_handler() { python3 $CLI_PATH change-hysteria2-sni --sni "$sni" - if systemctl is-active --quiet singbox.service; then - systemctl restart singbox.service + if systemctl is-active --quiet hysteria-singbox.service; then + systemctl restart hysteria-singbox.service fi } @@ -422,8 +422,8 @@ telegram_bot_handler() { case $option in 1) - if systemctl is-active --quiet hysteria-bot.service; then - echo "The hysteria-bot.service is already active." + if systemctl is-active --quiet hysteria-telegram-bot.service; then + echo "The hysteria-telegram-bot.service is already active." else while true; do read -e -p "Enter the Telegram bot token: " token @@ -470,8 +470,8 @@ singbox_handler() { case $option in 1) - if systemctl is-active --quiet singbox.service; then - echo "The singbox.service is already active." + if systemctl is-active --quiet hysteria-singbox.service; then + echo "The hysteria-singbox.service is already active." else while true; do read -e -p "Enter the domain name for the SSL certificate: " domain @@ -497,8 +497,8 @@ singbox_handler() { fi ;; 2) - if ! systemctl is-active --quiet singbox.service; then - echo "The singbox.service is already inactive." + if ! systemctl is-active --quiet hysteria-singbox.service; then + echo "The hysteria-singbox.service is already inactive." else python3 $CLI_PATH singbox -a stop fi @@ -522,8 +522,8 @@ normalsub_handler() { case $option in 1) - if systemctl is-active --quiet normalsub.service; then - echo "The normalsub.service is already active." + if systemctl is-active --quiet hysteria-normal-sub.service; then + echo "The hysteria-normal-sub.service is already active." else while true; do read -e -p "Enter the domain name for the SSL certificate: " domain @@ -549,8 +549,8 @@ normalsub_handler() { fi ;; 2) - if ! systemctl is-active --quiet normalsub.service; then - echo "The normalsub.service is already inactive." + if ! systemctl is-active --quiet hysteria-normal-sub.service; then + echo "The hysteria-normal-sub.service is already inactive." else python3 $CLI_PATH normal-sub -a stop fi @@ -581,8 +581,8 @@ webpanel_handler() { case $option in 1) - if systemctl is-active --quiet webpanel.service; then - echo "The webpanel.service is already active." + if systemctl is-active --quiet hysteria-webpanel.service; then + echo "The hysteria-webpanel.service is already active." else while true; do read -e -p "Enter the domain name for the SSL certificate: " domain @@ -626,8 +626,8 @@ webpanel_handler() { fi ;; 2) - if ! systemctl is-active --quiet webpanel.service; then - echo "The webpanel.service is already inactive." + if ! systemctl is-active --quiet hysteria-webpanel.service; then + echo "The hysteria-webpanel.service is already inactive." else python3 $CLI_PATH webpanel -a stop fi diff --git a/upgrade.sh b/upgrade.sh index 39cbbed..7896c9b 100644 --- a/upgrade.sh +++ b/upgrade.sh @@ -79,9 +79,9 @@ pip install -r requirements.txt echo "Restarting hysteria services" systemctl restart hysteria-server.service -systemctl restart hysteria-bot.service -systemctl restart singbox.service -systemctl restart webpanel.service +systemctl restart hysteria-telegram-bot.service +systemctl restart hysteria-singbox.service +systemctl restart hysteria-webpanel.service echo "Checking hysteria-server.service status" if systemctl is-active --quiet hysteria-server.service; then