Update: add a script to attach to the Console + add the same "header"

This commit is contained in:
Peritia 2026-02-10 15:51:55 +01:00
parent c0a2e941fb
commit 79ef3fdfd0
8 changed files with 233 additions and 8 deletions

View file

@ -1,6 +1,7 @@
#!/usr/bin/env bash
set -euo pipefail
# Injected by Nix
RSYNC_BIN="@RSYNC_BIN@"
DATA_DIR="@DATA_DIR@"
@ -20,6 +21,10 @@ PV_BIN="@PV_BIN@"
DU_BIN="@DU_BIN@"
BZIP2_BIN="@BZIP2_BIN@"
XZ_BIN="@XZ_BIN@"
WC_BIN="@WC_BIN@"
FIND_BIN="@FIND_BIN@"
TMUX_BIN="@TMUX_BIN@"
# Convenience wrappers
rsync_cmd="$RSYNC_BIN"
@ -35,11 +40,36 @@ pv_cmd="$PV_BIN"
du_cmd="$DU_BIN"
bzip2_cmd="$BZIP2_BIN"
xz_cmd="$XZ_BIN"
wc_cmd="$WC_BIN"
find_cmd="$FIND_BIN"
tmux_cmd="$TMUX_BIN"
# PATH extension
# (only figured that out later if you add it here it can actually just use the bin)
# So you can easily just switch out the "*_cmd" with the "normal" name
# export PATH="$(dirname "$GZIP_BIN")":"$(dirname "$ZSTD_BIN")":"$(dirname "$PV_BIN")":"$(dirname "$DU_BIN")":"$(dirname "$BZIP2_BIN")":"$(dirname "$XZ_BIN")":"$PATH"
# Extend PATH with all injected binaries so we can call them directly
for bin in \
"$RSYNC_BIN" \
"$MCSTATUS_BIN" \
"$MCRCON_BIN" \
"$AWK_BIN" \
"$TAR_BIN" \
"$ZIP_BIN" \
"$UNZIP_BIN" \
"$GZIP_BIN" \
"$ZSTD_BIN" \
"$PV_BIN" \
"$DU_BIN" \
"$BZIP2_BIN" \
"$XZ_BIN" \
"$WC_BIN" \
"$FIND_BIN" \
"$TMUX_BIN"
do
export PATH="$(dirname "$bin"):$PATH"
done