From 2b0e6b35f5aa32d6bf615bc70308b22c2f98d724 Mon Sep 17 00:00:00 2001 From: Rohan Barar Date: Sun, 25 Jan 2026 21:49:56 +1100 Subject: [PATCH 1/7] Improve FreeRDP process lifecycle tracking and cleanup Signed-off-by: Rohan Barar --- bin/winapps | 71 +++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 61 insertions(+), 10 deletions(-) diff --git a/bin/winapps b/bin/winapps index 1eaccc8..b9f2b0b 100755 --- a/bin/winapps +++ b/bin/winapps @@ -54,6 +54,7 @@ AUTOPAUSE_TIME="300" DEBUG="true" BOOT_TIMEOUT=120 HIDEF="on" +RDP_FLATPAK=0 RDP_FLAGS_WINDOWS="" RDP_FLAGS_NON_WINDOWS="" @@ -62,19 +63,54 @@ FREERDP_PID=-1 NEEDED_BOOT=false ### TRAPS ### -# Catch SIGINT (CTRL+C) to call 'waCleanUp'. -trap waCleanUp SIGINT +# Catch SIGINT (CTRL+C) and SIGTERM to call 'waCleanUpAndExit'. +trap waCleanUpAndExit SIGINT SIGTERM ### FUNCTIONS ### # Name: 'waCleanUp' # Role: Clean up remains prior to exit. -waCleanUp() { +function waCleanUp() { + for proc_file in "${APPDATA_PATH}"/FreeRDP_Process_*.cproc; do + # Protect against glob non-expansion. + [[ -f "$proc_file" ]] || break + + # Extract the file name from the path. + cproc=$(basename "$proc_file") + + # Remove the 'FreeRDP_Process_' prefix. + cproc="${cproc#FreeRDP_Process_}" + + # Remove the '.cproc' file extension. + cproc="${cproc%.cproc}" + + if [[ "$cproc" =~ ^[0-9]+$ ]]; then + # Proceed if process dir missing OR comm unreadable OR name doesn’t match. + if [[ ! -d "/proc/$cproc" ]] || [ ! -r "/proc/$cproc/comm" ] || [[ $(<"/proc/$cproc/comm") != *freerdp* ]]; then + # Delete the file. + rm "$proc_file" &>/dev/null + fi + elif [[ "$cproc" == "Flatpak" ]]; then + if command -v flatpak > /dev/null 2>&1; then + # Proceed if the flatpak is not running. + if ! flatpak ps --columns=application | grep -q "^com.freerdp.FreeRDP$"; then + # Delete the file. + rm "$proc_file" &>/dev/null + fi + fi + fi + done +} + +function waCleanUpAndExit() { # Kill FreeRDP. [ "$FREERDP_PID" -gt 0 ] && kill -9 "$FREERDP_PID" &>/dev/null # Remove '.cproc' file. [ -f "${APPDATA_PATH}/FreeRDP_Process_${FREERDP_PID}.cproc" ] && rm "${APPDATA_PATH}/FreeRDP_Process_${FREERDP_PID}.cproc" &>/dev/null + # Run cleanup. + waCleanUp + # Terminate script. exit 1 } @@ -284,6 +320,7 @@ function waGetFreeRDPCommand() { FREERDP_MAJOR_VERSION=$(flatpak list --columns=application,version | grep "^com.freerdp.FreeRDP" | awk '{print $2}' | cut -d'.' -f1) if [[ $FREERDP_MAJOR_VERSION =~ ^[0-9]+$ ]] && ((FREERDP_MAJOR_VERSION >= 3)); then FREERDP_COMMAND="flatpak run --command=xfreerdp com.freerdp.FreeRDP" + RDP_FLATPAK=1 fi fi fi @@ -699,15 +736,28 @@ function waRunCommand() { fi fi - if [ "$FREERDP_PID" -ne -1 ]; then - # Create a file with the process ID. - touch "${APPDATA_PATH}/FreeRDP_Process_${FREERDP_PID}.cproc" + if [[ "$RDP_FLATPAK" == "0" ]]; then + if [ "$FREERDP_PID" -ne -1 ]; then + # Create a file with the process ID. + touch "${APPDATA_PATH}/FreeRDP_Process_${FREERDP_PID}.cproc" + + # Wait for the process to terminate. + wait $FREERDP_PID + + # Remove the file with the process ID. + rm "${APPDATA_PATH}/FreeRDP_Process_${FREERDP_PID}.cproc" &>/dev/null + fi + else + # Create a file. + touch "${APPDATA_PATH}/FreeRDP_Process_Flatpak.cproc" # Wait for the process to terminate. - wait $FREERDP_PID + while flatpak ps --columns=application | grep -q "^com.freerdp.FreeRDP$"; do + sleep 5 + done - # Remove the file with the process ID. - rm "${APPDATA_PATH}/FreeRDP_Process_${FREERDP_PID}.cproc" &>/dev/null + # Remove the file. + rm "${APPDATA_PATH}/FreeRDP_Process_Flatpak.cproc" &>/dev/null fi } @@ -803,6 +853,7 @@ dprint "HOME_DIR: ${HOME}" waLastRun waLoadConfig waGetFreeRDPCommand +waCleanUp # If using podman backend, modify the FreeRDP command to enter a new namespace. if [ "$WAFLAVOR" = "podman" ]; then @@ -829,4 +880,4 @@ if [[ "$AUTOPAUSE" == "on" ]]; then waCheckIdle fi -dprint "END" +dprint "END" \ No newline at end of file From c97398bc60255d1a63d61b703d4642248b143089 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 25 Jan 2026 11:22:41 +0000 Subject: [PATCH 2/7] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- bin/winapps | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/winapps b/bin/winapps index b9f2b0b..518c067 100755 --- a/bin/winapps +++ b/bin/winapps @@ -880,4 +880,4 @@ if [[ "$AUTOPAUSE" == "on" ]]; then waCheckIdle fi -dprint "END" \ No newline at end of file +dprint "END" From 7f3043fa2026ec91a3724bcf0b9b007ed2558c27 Mon Sep 17 00:00:00 2001 From: Rohan Barar Date: Mon, 26 Jan 2026 17:33:01 +1100 Subject: [PATCH 3/7] Improved 'waCleanUpAndExit' logic Signed-off-by: Rohan Barar --- bin/winapps | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/bin/winapps b/bin/winapps index 518c067..f4a5edf 100755 --- a/bin/winapps +++ b/bin/winapps @@ -85,7 +85,7 @@ function waCleanUp() { if [[ "$cproc" =~ ^[0-9]+$ ]]; then # Proceed if process dir missing OR comm unreadable OR name doesn’t match. - if [[ ! -d "/proc/$cproc" ]] || [ ! -r "/proc/$cproc/comm" ] || [[ $(<"/proc/$cproc/comm") != *freerdp* ]]; then + if [[ ! -d "/proc/$cproc" ]] || [[ ! -r "/proc/$cproc/comm" ]] || [[ $(<"/proc/$cproc/comm") != *freerdp* ]]; then # Delete the file. rm "$proc_file" &>/dev/null fi @@ -103,10 +103,36 @@ function waCleanUp() { function waCleanUpAndExit() { # Kill FreeRDP. - [ "$FREERDP_PID" -gt 0 ] && kill -9 "$FREERDP_PID" &>/dev/null + if [[ "$RDP_FLATPAK" == "0" ]]; then + if [[ "$FREERDP_PID" =~ ^[1-9][0-9]*$ ]] && \ + [[ -d "/proc/$FREERDP_PID" ]] && \ + [[ -r "/proc/$FREERDP_PID/comm" ]] && \ + [[ $(<"/proc/$FREERDP_PID/comm") == *freerdp* ]]; then + # SIGTERM + kill -15 "$FREERDP_PID" &>/dev/null - # Remove '.cproc' file. - [ -f "${APPDATA_PATH}/FreeRDP_Process_${FREERDP_PID}.cproc" ] && rm "${APPDATA_PATH}/FreeRDP_Process_${FREERDP_PID}.cproc" &>/dev/null + # Wait up to 5 seconds. + for _ in {1..5}; do + sleep 1 + [[ ! -d "/proc/$FREERDP_PID" ]] && break + done + + # SIGKILL + if [[ -d "/proc/$FREERDP_PID" ]] && \ + [[ -r "/proc/$FREERDP_PID/comm" ]] && \ + [[ $(<"/proc/$FREERDP_PID/comm") == *freerdp* ]]; then + kill -9 "$FREERDP_PID" &>/dev/null + fi + + # Remove '.cproc' file. + rm -f -- "${APPDATA_PATH}/FreeRDP_Process_${FREERDP_PID}.cproc" + fi + else + if command -v flatpak >/dev/null 2>&1 && flatpak ps --columns=application | grep -q "^com.freerdp.FreeRDP$"; then + # Terminate the process. + flatpak kill com.freerdp.FreeRDP &>/dev/null + fi + fi # Run cleanup. waCleanUp From 7cc5df7c1b61554c7fd44188f483d322d402354b Mon Sep 17 00:00:00 2001 From: Rohan Barar Date: Mon, 26 Jan 2026 17:45:13 +1100 Subject: [PATCH 4/7] harden shell usage to prevent command injection Signed-off-by: Rohan Barar --- bin/winapps | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/bin/winapps b/bin/winapps index f4a5edf..ed329ae 100755 --- a/bin/winapps +++ b/bin/winapps @@ -87,14 +87,14 @@ function waCleanUp() { # Proceed if process dir missing OR comm unreadable OR name doesn’t match. if [[ ! -d "/proc/$cproc" ]] || [[ ! -r "/proc/$cproc/comm" ]] || [[ $(<"/proc/$cproc/comm") != *freerdp* ]]; then # Delete the file. - rm "$proc_file" &>/dev/null + rm -- "$proc_file" &>/dev/null fi elif [[ "$cproc" == "Flatpak" ]]; then if command -v flatpak > /dev/null 2>&1; then # Proceed if the flatpak is not running. if ! flatpak ps --columns=application | grep -q "^com.freerdp.FreeRDP$"; then # Delete the file. - rm "$proc_file" &>/dev/null + rm -- "$proc_file" &>/dev/null fi fi fi @@ -305,7 +305,7 @@ function waLastRun() { fi # Update the file modification time with the current time. - touch "$LASTRUN_PATH" + touch -- "$LASTRUN_PATH" CURR_RUN_UNIX_TIME=$(stat -t -c %Y "$LASTRUN_PATH") dprint "THIS_RUN: ${CURR_RUN_UNIX_TIME}" } @@ -642,7 +642,7 @@ function waCheckPortOpen() { if [ "$TIME_ELAPSED" -eq "$TIME_INTERVAL" ]; then notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Requesting Windows IP address..." fi - RDP_IP=$(ip neigh show | grep "$VM_MAC" | grep -oE "([0-9]{1,3}\.){3}[0-9]{1,3}") # VM IP address. + RDP_IP=$(ip neigh show | grep -F -- "$VM_MAC" | grep -oE "([0-9]{1,3}\.){3}[0-9]{1,3}") # VM IP address. [ -n "$RDP_IP" ] && break sleep $TIME_INTERVAL TIME_ELAPSED=$((TIME_ELAPSED + TIME_INTERVAL)) @@ -765,17 +765,17 @@ function waRunCommand() { if [[ "$RDP_FLATPAK" == "0" ]]; then if [ "$FREERDP_PID" -ne -1 ]; then # Create a file with the process ID. - touch "${APPDATA_PATH}/FreeRDP_Process_${FREERDP_PID}.cproc" + touch -- "${APPDATA_PATH}/FreeRDP_Process_${FREERDP_PID}.cproc" # Wait for the process to terminate. - wait $FREERDP_PID + wait "$FREERDP_PID" # Remove the file with the process ID. - rm "${APPDATA_PATH}/FreeRDP_Process_${FREERDP_PID}.cproc" &>/dev/null + rm -- "${APPDATA_PATH}/FreeRDP_Process_${FREERDP_PID}.cproc" &>/dev/null fi else # Create a file. - touch "${APPDATA_PATH}/FreeRDP_Process_Flatpak.cproc" + touch -- "${APPDATA_PATH}/FreeRDP_Process_Flatpak.cproc" # Wait for the process to terminate. while flatpak ps --columns=application | grep -q "^com.freerdp.FreeRDP$"; do @@ -783,7 +783,7 @@ function waRunCommand() { done # Remove the file. - rm "${APPDATA_PATH}/FreeRDP_Process_Flatpak.cproc" &>/dev/null + rm -- "${APPDATA_PATH}/FreeRDP_Process_Flatpak.cproc" &>/dev/null fi } @@ -856,7 +856,7 @@ function waTimeSync() { dprint "DETECTED SLEEP/WAKE CYCLE (uptime gap: ${UPTIME_DIFF}s). CREATING SLEEP MARKER TO SYNC WINDOWS TIME." # Create sleep marker which will be monitored by Windows VM to trigger time sync - touch "$SLEEP_MARKER" + touch -- "$SLEEP_MARKER" dprint "CREATED SLEEP MARKER" fi From 490abd1ba227fc2140f5a0e059d8174a1da38c8e Mon Sep 17 00:00:00 2001 From: Rohan Barar Date: Mon, 2 Feb 2026 17:28:22 +1100 Subject: [PATCH 5/7] Add help function. Signed-off-by: Rohan Barar --- bin/winapps | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/bin/winapps b/bin/winapps index ed329ae..8523396 100755 --- a/bin/winapps +++ b/bin/winapps @@ -234,6 +234,29 @@ function waFixRemovableMedia() { "WinApps Notice" "Using default removable media path: $REMOVABLE_MEDIA" fi } + +# Name: 'waHelp' +# Role: Print usage information. +function waHelp() { + local script_name + script_name="$(basename "$0")" + + echo "Usage:" + echo " ${script_name} help" + echo " ${script_name} killrdp" + echo " ${script_name} windows" + echo " ${script_name} manual " + echo " ${script_name} [file]" + echo + + echo "Commands:" + echo " help --> Show this help message." + echo " killrdp --> Terminate any running WinApps FreeRDP sessions." + echo " windows --> Start a full Windows desktop RDP session." + echo " manual --> Start a RemoteApp session for an arbitrary executable." + echo " [file] --> Start a community-tested application using a preconfigured definition. Optionally open a file." +} + # Name: 'waFixScale' # Role: Since FreeRDP only supports '/scale' values of 100, 140 or 180, find the closest supported argument to the user's configuration. function waFixScale() { From bb93c864b996772e80521dcac3bc3429f7aa44b9 Mon Sep 17 00:00:00 2001 From: Rohan Barar Date: Mon, 2 Feb 2026 17:52:58 +1100 Subject: [PATCH 6/7] Add function to kill FreeRDP. Signed-off-by: Rohan Barar --- bin/winapps | 94 ++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 71 insertions(+), 23 deletions(-) diff --git a/bin/winapps b/bin/winapps index 8523396..90cb194 100755 --- a/bin/winapps +++ b/bin/winapps @@ -101,40 +101,85 @@ function waCleanUp() { done } -function waCleanUpAndExit() { - # Kill FreeRDP. - if [[ "$RDP_FLATPAK" == "0" ]]; then - if [[ "$FREERDP_PID" =~ ^[1-9][0-9]*$ ]] && \ - [[ -d "/proc/$FREERDP_PID" ]] && \ - [[ -r "/proc/$FREERDP_PID/comm" ]] && \ - [[ $(<"/proc/$FREERDP_PID/comm") == *freerdp* ]]; then +# Name: 'waKillFreeRDP' +# Role: Kill WinApps FreeRDP sessions. +function waKillFreeRDP() { + # Declare variables. + local TERMINATED_PROCESS_IDS=() + local TERMINATED_PROCESS_IDS_STRING="" + + # Loop through each matching file and add to the array. + for FREERDP_PROCESS_FILE in "${APPDATA_PATH}/FreeRDP_Process_"*.cproc; do + # Ensure the pattern is not treated as a literal string if no files match. + [[ -f "$FREERDP_PROCESS_FILE" ]] || break + + # Extract the file name from the path. + FREERDP_PROCESS_FILE=$(basename "$FREERDP_PROCESS_FILE") + + # Remove the 'FreeRDP_Process_' prefix. + FREERDP_PROCESS_FILE="${FREERDP_PROCESS_FILE#FreeRDP_Process_}" + + # Remove the '.cproc' file extension. + FREERDP_PROCESS_FILE="${FREERDP_PROCESS_FILE%.cproc}" + + # Track termination action. + KILLED=false + + # Terminate processes. + if [[ "$FREERDP_PROCESS_FILE" =~ ^[0-9]+$ ]] && \ + [[ -d "/proc/$FREERDP_PROCESS_FILE" ]] && \ + [[ -r "/proc/$FREERDP_PROCESS_FILE/comm" ]] && \ + [[ $(<"/proc/$FREERDP_PROCESS_FILE/comm") == *freerdp* ]]; then # SIGTERM - kill -15 "$FREERDP_PID" &>/dev/null + kill -15 "$FREERDP_PROCESS_FILE" &>/dev/null # Wait up to 5 seconds. for _ in {1..5}; do sleep 1 - [[ ! -d "/proc/$FREERDP_PID" ]] && break + [[ ! -d "/proc/$FREERDP_PROCESS_FILE" ]] && break done # SIGKILL - if [[ -d "/proc/$FREERDP_PID" ]] && \ - [[ -r "/proc/$FREERDP_PID/comm" ]] && \ - [[ $(<"/proc/$FREERDP_PID/comm") == *freerdp* ]]; then - kill -9 "$FREERDP_PID" &>/dev/null + if [[ -d "/proc/$FREERDP_PROCESS_FILE" ]] && \ + [[ -r "/proc/$FREERDP_PROCESS_FILE/comm" ]] && \ + [[ $(<"/proc/$FREERDP_PROCESS_FILE/comm") == *freerdp* ]]; then + kill -9 "$FREERDP_PROCESS_FILE" &>/dev/null fi - # Remove '.cproc' file. - rm -f -- "${APPDATA_PATH}/FreeRDP_Process_${FREERDP_PID}.cproc" - fi - else - if command -v flatpak >/dev/null 2>&1 && flatpak ps --columns=application | grep -q "^com.freerdp.FreeRDP$"; then + # Track termination action. + KILLED=true + elif [[ "$FREERDP_PROCESS_FILE" == "Flatpak" ]] && \ + command -v flatpak >/dev/null 2>&1 && \ + flatpak ps --columns=application | grep -q "^com.freerdp.FreeRDP$"; then # Terminate the process. flatpak kill com.freerdp.FreeRDP &>/dev/null - fi - fi - # Run cleanup. + # Track termination action. + KILLED=true + fi + + # Delete FreeRDP process tracking file. + # NOTE: Better practice to call 'waCleanUp' to handle this in case FreeRDP process(es) still not killed. + #rm -- "${APPDATA_PATH}/FreeRDP_Process_${FREERDP_PROCESS_FILE}.cproc" &>/dev/null + + if [[ "$KILLED" == true ]]; then + # Add the process ID to the list of terminated processes. + TERMINATED_PROCESS_IDS+=("$FREERDP_PROCESS_FILE") + fi + done + + # Display feedback if any processes were terminated. + if [ ${#TERMINATED_PROCESS_IDS[@]} -ne 0 ]; then + echo "Killed FreeRDP process(es):" + printf '%s\n' "${TERMINATED_PROCESS_IDS[@]}" + fi +} + +function waCleanUpAndExit() { + # Kill FreeRDP processes. + waKillFreeRDP + + # Clean orphaned files. waCleanUp # Terminate script. @@ -243,18 +288,21 @@ function waHelp() { echo "Usage:" echo " ${script_name} help" - echo " ${script_name} killrdp" echo " ${script_name} windows" echo " ${script_name} manual " echo " ${script_name} [file]" + echo " ${script_name} killrdp" + echo " ${script_name} cleanrdp" echo echo "Commands:" echo " help --> Show this help message." - echo " killrdp --> Terminate any running WinApps FreeRDP sessions." echo " windows --> Start a full Windows desktop RDP session." echo " manual --> Start a RemoteApp session for an arbitrary executable." echo " [file] --> Start a community-tested application using a preconfigured definition. Optionally open a file." + echo " killrdp --> Terminate any running WinApps FreeRDP sessions." + echo " cleanrdp --> Remove orphaned FreeRDP process tracking files." + exit 0 } # Name: 'waFixScale' From bca9be45aafdeaf5ccb65515dbb1fa1cb1e0e3dd Mon Sep 17 00:00:00 2001 From: Rohan Barar Date: Mon, 2 Feb 2026 18:24:21 +1100 Subject: [PATCH 7/7] Add early dispatch function to handle help, killing FreeRDP processes and cleaning FreeRDP process tracking files. Signed-off-by: Rohan Barar --- bin/winapps | 41 +++++++++++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/bin/winapps b/bin/winapps index 90cb194..2277319 100755 --- a/bin/winapps +++ b/bin/winapps @@ -63,13 +63,13 @@ FREERDP_PID=-1 NEEDED_BOOT=false ### TRAPS ### -# Catch SIGINT (CTRL+C) and SIGTERM to call 'waCleanUpAndExit'. -trap waCleanUpAndExit SIGINT SIGTERM +# Catch SIGINT (CTRL+C) and SIGTERM to call 'waKillCleanExit'. +trap waKillCleanExit SIGINT SIGTERM ### FUNCTIONS ### -# Name: 'waCleanUp' +# Name: 'waCleanFreeRDP' # Role: Clean up remains prior to exit. -function waCleanUp() { +function waCleanFreeRDP() { for proc_file in "${APPDATA_PATH}"/FreeRDP_Process_*.cproc; do # Protect against glob non-expansion. [[ -f "$proc_file" ]] || break @@ -106,7 +106,6 @@ function waCleanUp() { function waKillFreeRDP() { # Declare variables. local TERMINATED_PROCESS_IDS=() - local TERMINATED_PROCESS_IDS_STRING="" # Loop through each matching file and add to the array. for FREERDP_PROCESS_FILE in "${APPDATA_PATH}/FreeRDP_Process_"*.cproc; do @@ -159,7 +158,7 @@ function waKillFreeRDP() { fi # Delete FreeRDP process tracking file. - # NOTE: Better practice to call 'waCleanUp' to handle this in case FreeRDP process(es) still not killed. + # NOTE: Better practice to call 'waCleanFreeRDP' to handle this in case FreeRDP process(es) still not killed. #rm -- "${APPDATA_PATH}/FreeRDP_Process_${FREERDP_PROCESS_FILE}.cproc" &>/dev/null if [[ "$KILLED" == true ]]; then @@ -170,22 +169,44 @@ function waKillFreeRDP() { # Display feedback if any processes were terminated. if [ ${#TERMINATED_PROCESS_IDS[@]} -ne 0 ]; then + dprint "KILLED FREERDP PROCESSES: $( + IFS=', ' + printf '%s' "${TERMINATED_PROCESS_IDS[*]}" + )." echo "Killed FreeRDP process(es):" printf '%s\n' "${TERMINATED_PROCESS_IDS[@]}" fi } -function waCleanUpAndExit() { +# Name: 'waKillCleanExit' +# Role: Kill FreeRDP processes and clean process tracking files when WinApps is forcefully terminated. +function waKillCleanExit() { # Kill FreeRDP processes. waKillFreeRDP # Clean orphaned files. - waCleanUp + waCleanFreeRDP # Terminate script. exit 1 } +# Name: 'waEarlyDispatch' +# Role: Handle lightweight subcommands. +function waEarlyDispatch() { + if [[ -z "${1:-}" ]] || [[ "$1" == "help" ]]; then + waHelp + exit 0 + elif [[ "$1" == "killrdp" ]]; then + waKillFreeRDP + waCleanFreeRDP + exit 0 + elif [[ "$1" == "cleanrdp" ]]; then + waCleanFreeRDP + exit 0 + fi +} + # Name: 'waThrowExit' # Role: Throw an error message and exit the script. function waThrowExit() { @@ -302,7 +323,6 @@ function waHelp() { echo " [file] --> Start a community-tested application using a preconfigured definition. Optionally open a file." echo " killrdp --> Terminate any running WinApps FreeRDP sessions." echo " cleanrdp --> Remove orphaned FreeRDP process tracking files." - exit 0 } # Name: 'waFixScale' @@ -947,10 +967,11 @@ dprint "START" dprint "SCRIPT_DIR: ${SCRIPT_DIR_PATH}" dprint "SCRIPT_ARGS: ${*}" dprint "HOME_DIR: ${HOME}" +waEarlyDispatch "$@" waLastRun waLoadConfig waGetFreeRDPCommand -waCleanUp +waCleanFreeRDP # If using podman backend, modify the FreeRDP command to enter a new namespace. if [ "$WAFLAVOR" = "podman" ]; then