mytools/rustdesk_profile
ranomier 0093a34d48 added back passing arguemnts.
It seems to not crash anymore, but seems to not care about
command line parameter
2025-01-27 15:55:52 +01:00

24 lines
701 B
Bash
Executable file

#!/usr/bin/env bash
# docstring=have and create multiple rustdesk profiles
set -E -o pipefail
shopt -s failglob
export LC_ALL=C.UTF8
# define frist element in argument list as profile name
RUSTDESK_PROFILE="$1"
# Check user input
if [[ $RUSTDESK_PROFILE == \-* ]] || [[ $RUSTDESK_PROFILE == \-\-* ]] || [[ -z "$RUSTDESK_PROFILE" ]];
then
#printf "Please provide first a profile name and then optional options with - or --.\n"
printf "Please provide a profile name.\n"
exit 1
fi
# make sure profile folder for config exists.
export XDG_CONFIG_HOME="$HOME/.config/rustdesk_${RUSTDESK_PROFILE}"
mkdir -p "$XDG_CONFIG_HOME"
printf 'Using profile: %s\n' "$XDG_CONFIG_HOME"
#exit 0
rustdesk "${*:2}"