diff --git a/squashkiwi-streaming/install.sh b/squashkiwi-streaming/install.sh index 151476d..69a87dc 100755 --- a/squashkiwi-streaming/install.sh +++ b/squashkiwi-streaming/install.sh @@ -18,10 +18,10 @@ mkdir -p "${LOCAL_DATA_FOLDER}/config/web" cp -r "${SCRIPT_DIR}/config/"* "${LOCAL_DATA_FOLDER}/config/" || _die "Failed to copy config files" # URL-encode the camera password if it contains special characters -if [[ "${CAMERA_PASSWORD}" == *[!\@\#\$\&\%]* ]]; then +# Only encode if not already encoded (check for % sign) +if [[ "${CAMERA_PASSWORD}" == *[!\@\#\$\&]* ]] && [[ "${CAMERA_PASSWORD}" != *%* ]]; then echo "Note: Camera password contains special characters. Encoding for RTSP URL..." - CAMERA_PASSWORD_ENCODED=$(echo -n "${CAMERA_PASSWORD}" | sed 's/!/%21/g; s/@/%40/g; s/#/%23/g; s/\$/%24/g; s/&/%26/g; s/%/%25/g') - export CAMERA_PASSWORD="${CAMERA_PASSWORD_ENCODED}" + CAMERA_PASSWORD=$(echo -n "${CAMERA_PASSWORD}" | sed 's/!/%21/g; s/@/%40/g; s/#/%23/g; s/\$/%24/g; s/&/%26/g') fi # Create .env file for docker-compose with all required variables