From 5c3c632a770fcf5c32284a9640018bf8e7788a20 Mon Sep 17 00:00:00 2001 From: PrincessPi3 Date: Mon, 18 May 2026 08:38:31 -0600 Subject: [PATCH] i thiiink da img_dump be workan ok nao.. maybe idk --- customscripts/img_dump.sh | 40 +++++++++++++++++------------ customscripts/watching_file_grow.sh | 1 + customscripts/xrdp_cmd | 9 +++---- 3 files changed, 28 insertions(+), 22 deletions(-) create mode 100644 customscripts/watching_file_grow.sh diff --git a/customscripts/img_dump.sh b/customscripts/img_dump.sh index b638379..8925498 100644 --- a/customscripts/img_dump.sh +++ b/customscripts/img_dump.sh @@ -1,12 +1,24 @@ #!/bin/bash set -e # fail on fuckups to iterate fasterrr - timestamp="$(date +%Y-%m-%d-%H%M-%Z)" disk="" log="${timestamp}_img_dump_testin.log" echo > "$log" # initialize to empty img_name="${timestamp}_Kali-Pi5-1TB-Working.img" +# trap function cleanup +cleanup () { + webhook "img_dump errored! Cleaning up! seconds: $SECONDS line: $LINENO command: $BASHCOMMAND" true + rm -f "$img_name" 2>/dev/null + rm -f "$img_name.sha256" 2>/dev/null + rm -f "$img_name.xz" 2>/dev/null + rm -f "$img_name.xz.sha256" 2>/dev/null + rm -f "$log" 2>/dev/null +} + +# cleanup any errant files on error +trap cleanup EXIT + echo -e "\n\n\nSTARTING DUMP OPS\n\n\n" lsblk @@ -14,9 +26,6 @@ read -p "Enter Disk Name (ex. sda, sdb no /dev or anything else) " disk_choice disk="/dev/$disk_choice" clear -# echo "runnin inline xz" -# sudo dd if=$disk status=progress bs=1M | xz -c > throwaway_image_post0_inline_xz_14052026.img.xz - webhook "runnan raw dd img on $disk at to $img_name using 4M bs size (Script Has Run $SECONDS Seconds)" sudo dd if="$disk" of="$img_name" status=progress bs=4M | tee -a "$log" @@ -27,19 +36,11 @@ sudo chmod 660 "$img_name" webhook "generating sha256 checksum of $img_name (from $disk) to $img_name.sha256 (Script Has Run $SECONDS Seconds)" sha256sum "$img_name" | tee -a "$img_name.sha256" -### commented out in favor of pishrink -# webhook "xz compressing raw $img_name.xz (Script Has Run $SECONDS Seconds)" -# xz -v "$img_name" | tee -a "$log" # yieldds throwaway_image_raw_dd_img_14052026.img.xz - -# if [ -f "$img_name" ]; then -# webhook "$image_name still there! Deleting by force!" -# sudo rm -f "$img_name" -# fi - -# -v verbose -# -r use advanced filesystem repair option if the normal one fails -# -Z xz compression -# -a compress using multiple cores +# pishrink +## -v verbose +## -r use advanced filesystem repair option if the normal one fails +## -Z xz compression +## -a compress using multiple cores webhook "doing pishrink from $img_name ($disk) to $img_name.xz (Script Has Run $SECONDS Seconds)" pishrink -v -r -Z -a "$img_name" @@ -49,4 +50,9 @@ xz -t -v "$img_name.xz" | tee -a "$log" webhook "Generating sha256 checksums of $img_name.xz to $img_name.xz.sha256 (Script Has Run $SECONDS Seconds)" sha256sum "$img_name.xz" | tee -a "$img_name.xz.sha256" +if [ -f "$img_name" ]; then + webhook "$img_name still there! Deleting by force!" + sudo rm -f "$img_name" +fi + webhook "\n\n\nFUCKING FINAALLY ITS OVER\n\n\n\t$SECONDS Seconds Elapsed\n\tDateTime Started: $timestamp DateTime Finished: $(date +%Y-%m-%d-%H%M-%Z)" \ No newline at end of file diff --git a/customscripts/watching_file_grow.sh b/customscripts/watching_file_grow.sh new file mode 100644 index 0000000..f567c82 --- /dev/null +++ b/customscripts/watching_file_grow.sh @@ -0,0 +1 @@ +img_name=2026-05-18-0635-MDT_Kali-Pi5-1TB-Working.img && logfile=2026-05-18-0652-MDT_img_dump_testin.log && watch -n 10 "du -h $img_name; du -b $img_name; echo; ls \"$img_name\" 2>/dev/null; ls \"$logfile\" 2>/dev/null; ls \"$img_name.xz\" 2>/dev/null; echo; \"echo Checksums:\" ls \"$img_name.sha256\" 2>/dev/null; ls \"$img_name.img.xz.sha256\" 2>/dev/null" \ No newline at end of file diff --git a/customscripts/xrdp_cmd b/customscripts/xrdp_cmd index 4aecb92..73c9433 100644 --- a/customscripts/xrdp_cmd +++ b/customscripts/xrdp_cmd @@ -1,12 +1,12 @@ #!/bin/bash port=3389 -if systemctl is-active --quiet xrdp; then +if systemctl is-active --quiet xrdp; then echo "Running XRDP Service Found Running, Stopping..." sudo systemctl stop xrdp && echo "OK! XRDP Stopped!" || echo "ERROR: XRDP Failed To Start! Retcode: $?" fi -if systemctl is-active --quiet lightdm; then +if systemctl is-active --quiet lightdm; then echo "Window Manager Found Running, Stopping It..." sudo systemctl stop lightdm && "OK! lightdm Stopped!" || echo "ERROR! Lightdm Did Not Stop! Retcode $?" # lightdm is xfce default fi @@ -15,8 +15,7 @@ echo "Starting XRDP..." sudo systemctl start xrdp && echo "OK! XRDP Running!" || echo "ERROR: XRDP Failed To Start Retcode: $?" echo "Starting Window Manager..." -sudo nohup startxfce4 > /dev/null 2>&1 & # fork dis to da background, alsooo use nohup to keep it live if terminal closes +sudo startxfce4 --replace # > /dev/null 2>&1 & # fork dis to da background, alsooo use nohup to keep it live if terminal closes echo "should be on RDP $(hostname -I | awk '{print $1}'):${port}" -echo -e "\n\ndonesizessn nyaa~ :3\n\t$(hostname -I | awk '{print $1}'):${port}"\n\n" - +echo -e "\n\ndonesizessn nyaa~ :3\n\t$(hostname -I | awk '{print $1}'):${port}\n\n" \ No newline at end of file