run remmina even without profile.

This commit is contained in:
Miroslav Šedivý 2025-03-30 21:42:45 +02:00
parent 49015a81c4
commit 0933235060

View file

@ -1,5 +1,4 @@
#!/bin/bash
set -u
err() {
echo "ERROR: $*" >&2
@ -16,8 +15,7 @@ if [[ -n "$REMMINA_PROFILE" ]]; then
exec remmina -c "$profile"
fi
[[ -z "$REMMINA_URL" ]] && err "Neither 'REMMINA_PROFILE' nor 'REMMINA_URL' found in env vars"
if [[ ! -z "$REMMINA_URL" ]]; then
readarray -t arr < <( echo -n "$REMMINA_URL" | perl -pe 's|^(\w+)\:\/\/(?:([^:]+)(?::([^@]+))?@)?(.*)$|\1\n\2\n\3\n\4|' )
proto="${arr[0]}"
user="${arr[1]}"
@ -35,4 +33,10 @@ remmina --set-option server="$host" --update-profile "$profile"
# remmina --set-option window_maximize=1 --update-profile "$profile"
# remmina --set-option scale=1 --update-profile "$profile"
echo "Running remmina with URL $REMMINA_URL"
exec remmina -c "$profile"
fi
echo "Running remmina without connection profile"
exec remmina