#!/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}"