Fix path related issues
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
|
||||
# Function to show URI if Hysteria2 is installed and active
|
||||
show_uri() {
|
||||
if [ -f "/etc/hysteria/users/users.json" ]; then
|
||||
if [ -f "/etc/hysteria/users.json" ]; then
|
||||
if systemctl is-active --quiet hysteria-server.service; then
|
||||
# Check if the username is provided as an argument
|
||||
if [ -z "$1" ]; then
|
||||
@ -13,9 +13,9 @@ show_uri() {
|
||||
username=$1
|
||||
|
||||
# Validate the username
|
||||
if jq -e "has(\"$username\")" /etc/hysteria/users/users.json > /dev/null; then
|
||||
if jq -e "has(\"$username\")" /etc/hysteria/users.json > /dev/null; then
|
||||
# Get the selected user's details
|
||||
authpassword=$(jq -r ".\"$username\".password" /etc/hysteria/users/users.json)
|
||||
authpassword=$(jq -r ".\"$username\".password" /etc/hysteria/users.json)
|
||||
port=$(jq -r '.listen' /etc/hysteria/config.json | cut -d':' -f2)
|
||||
sha256=$(jq -r '.tls.pinSHA256' /etc/hysteria/config.json)
|
||||
obfspassword=$(jq -r '.obfs.salamander.password' /etc/hysteria/config.json)
|
||||
@ -56,7 +56,7 @@ show_uri() {
|
||||
echo -e "\033[0;31mError:\033[0m Hysteria2 is not active."
|
||||
fi
|
||||
else
|
||||
echo -e "\033[0;31mError:\033[0m Config file /etc/hysteria/users/users.json not found."
|
||||
echo -e "\033[0;31mError:\033[0m Config file /etc/hysteria/users.json not found."
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user