-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
34 lines (26 loc) · 1.03 KB
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
# Define paths to SSL files and optional passphrase
SSL_CERT_FILE="certificates/fullchain1.pem"
SSL_KEY_FILE="certificates/privkey1.pem"
SSL_PASSPHRASE="" # Set this to your SSL key passphrase if needed
# Determine the path to python
if [ -x "/opt/conda/bin/python" ]; then
CMD="/opt/conda/bin/python"
else
CMD="python"
fi
# Initialize SSL options
SSL_OPTIONS=""
# Check if SSL certificate and key files exist
if [[ -f "$SSL_CERT_FILE" && -f "$SSL_KEY_FILE" ]]; then
echo "SSL files found. Enabling SSL support."
SSL_OPTIONS="--ssl_cert_file \"$SSL_CERT_FILE\" --ssl_key_file \"$SSL_KEY_FILE\""
# Add passphrase if provided
if [[ -n "$SSL_PASSPHRASE" ]]; then
SSL_OPTIONS="$SSL_OPTIONS --ssl_passphrase \"$SSL_PASSPHRASE\""
fi
else
echo "SSL files not found. Running without SSL support."
fi
# Run the Python server script with appropriate SSL options
eval "$CMD run_server.py --port 9090 --backend faster_whisper -fw 'faster-whisper-large-v3' $SSL_OPTIONS >> run_server.out 2>> run_server.err"