Fix indentation error

This commit is contained in:
Sarina
2024-07-22 16:48:22 +03:30
parent 65817ade14
commit a637425804

View File

@ -28,14 +28,24 @@ install_hysteria() {
# Step 5: Generate the base64 encoded SHA-256 fingerprint
echo "Generating base64 encoded SHA-256 fingerprint..."
echo "import re, base64, binascii
cat <<EOF > generate.py
import base64
import binascii
hex_string = \"$fingerprint\"
# Hexadecimal string
hex_string = "$fingerprint"
# Convert hex to binary
binary_data = binascii.unhexlify(hex_string)
# Encode binary data to base64
base64_encoded = base64.b64encode(binary_data).decode('utf-8')
print(\"sha256/\" + base64_encoded)" > generate.py
# Print the result prefixed with 'sha256/'
print('sha256/' + base64_encoded)
EOF
# Execute the Python script and capture the output
sha256=$(python3 generate.py)
# Step 7: Ask for the port number and validate input