Remove dependency to restart_hysteria_service function instead use
cli.py restart-hysteria2
This commit is contained in:
@ -68,7 +68,7 @@ if [ -f "$CONFIG_FILE" ]; then
|
||||
echo "Invalid option. Please try again."
|
||||
;;
|
||||
esac
|
||||
restart_hysteria_service >/dev/null 2>&1
|
||||
python3 /etc/hysteria/core/cli.py restart-hysteria2 > /dev/null 2>&1
|
||||
else
|
||||
echo "${red}Error:${NC} Config file $CONFIG_FILE not found."
|
||||
fi
|
||||
@ -10,7 +10,7 @@ else
|
||||
# Add the outbound configuration to the config.json file
|
||||
jq '.outbounds += [{"name": "warps", "type": "direct", "direct": {"mode": 4, "bindDevice": "wgcf"}}]' /etc/hysteria/config.json > /etc/hysteria/config_temp.json && mv /etc/hysteria/config_temp.json /etc/hysteria/config.json
|
||||
# Restart the hysteria-server service
|
||||
restart_hysteria_service >/dev/null 2>&1
|
||||
python3 /etc/hysteria/core/cli.py restart-hysteria2 > /dev/null 2>&1
|
||||
echo "WARP installed and outbound added to config.json."
|
||||
else
|
||||
echo "${red}Error:${NC} Config file /etc/hysteria/config.json not found."
|
||||
|
||||
@ -20,7 +20,7 @@ if systemctl is-active --quiet wg-quick@wgcf.service; then
|
||||
' /etc/hysteria/config.json > /etc/hysteria/config_temp.json && mv /etc/hysteria/config_temp.json /etc/hysteria/config.json
|
||||
jq 'del(.outbounds[] | select(.name == "warps" and .type == "direct" and .direct.mode == 4 and .direct.bindDevice == "wgcf"))' /etc/hysteria/config.json > /etc/hysteria/config_temp.json && mv /etc/hysteria/config_temp.json /etc/hysteria/config.json
|
||||
|
||||
restart_hysteria_service >/dev/null 2>&1
|
||||
python3 /etc/hysteria/core/cli.py restart-hysteria2 > /dev/null 2>&1
|
||||
echo "WARP uninstalled and configurations reset to default."
|
||||
else
|
||||
echo "${red}Error:${NC} Config file /etc/hysteria/config.json not found."
|
||||
|
||||
Reference in New Issue
Block a user