From a09a3c7e2cc6211f6623b0cc1a2bf2897d96c079 Mon Sep 17 00:00:00 2001 From: Matheus Albino Date: Mon, 8 Jul 2024 00:01:09 -0300 Subject: [PATCH] Adds scripts --- scripts/shell/discord-relay.sh | 17 +++++++++++++++++ scripts/shell/wslOff.sh | 1 + 2 files changed, 18 insertions(+) create mode 100755 scripts/shell/discord-relay.sh create mode 100755 scripts/shell/wslOff.sh diff --git a/scripts/shell/discord-relay.sh b/scripts/shell/discord-relay.sh new file mode 100755 index 0000000..5e58e53 --- /dev/null +++ b/scripts/shell/discord-relay.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +exec sudo socat UNIX-LISTEN:/var/run/discord-ipc-0,fork,group=discord,umask=007 EXEC:"npiperelay.exe -ep -s //./pipe/discord-ipc-0",nofork & +exit 0 + +# Function to check if socat is running +check_socat_running() { + pgrep -x socat > /dev/null +} + +# Main loop to continuously check and restart foo.sh if socat is not running +while true; do + if ! check_socat_running; then + exec sudo socat UNIX-LISTEN:/var/run/discord-ipc-0,fork,group=discord,umask=007 EXEC:"npiperelay.exe -ep -s //./pipe/discord-ipc-0",nofork + fi + sleep 10 # Adjust the sleep duration as per your requirement (in seconds) +done diff --git a/scripts/shell/wslOff.sh b/scripts/shell/wslOff.sh new file mode 100755 index 0000000..3860848 --- /dev/null +++ b/scripts/shell/wslOff.sh @@ -0,0 +1 @@ +wsl.exe --shutdown