Fix indentation error
This commit is contained in:
@ -28,14 +28,24 @@ install_hysteria() {
|
|||||||
|
|
||||||
# Step 5: Generate the base64 encoded SHA-256 fingerprint
|
# Step 5: Generate the base64 encoded SHA-256 fingerprint
|
||||||
echo "Generating 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
|
||||||
binary_data = binascii.unhexlify(hex_string)
|
hex_string = "$fingerprint"
|
||||||
base64_encoded = base64.b64encode(binary_data).decode('utf-8')
|
|
||||||
|
|
||||||
print(\"sha256/\" + base64_encoded)" > generate.py
|
# 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 the result prefixed with 'sha256/'
|
||||||
|
print('sha256/' + base64_encoded)
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Execute the Python script and capture the output
|
||||||
sha256=$(python3 generate.py)
|
sha256=$(python3 generate.py)
|
||||||
|
|
||||||
# Step 7: Ask for the port number and validate input
|
# Step 7: Ask for the port number and validate input
|
||||||
|
|||||||
Reference in New Issue
Block a user