i thiiink da img_dump be workan ok nao.. maybe idk
This commit is contained in:
+23
-17
@@ -1,12 +1,24 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e # fail on fuckups to iterate fasterrr
|
set -e # fail on fuckups to iterate fasterrr
|
||||||
|
|
||||||
timestamp="$(date +%Y-%m-%d-%H%M-%Z)"
|
timestamp="$(date +%Y-%m-%d-%H%M-%Z)"
|
||||||
disk=""
|
disk=""
|
||||||
log="${timestamp}_img_dump_testin.log"
|
log="${timestamp}_img_dump_testin.log"
|
||||||
echo > "$log" # initialize to empty
|
echo > "$log" # initialize to empty
|
||||||
img_name="${timestamp}_Kali-Pi5-1TB-Working.img"
|
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"
|
echo -e "\n\n\nSTARTING DUMP OPS\n\n\n"
|
||||||
|
|
||||||
lsblk
|
lsblk
|
||||||
@@ -14,9 +26,6 @@ read -p "Enter Disk Name (ex. sda, sdb no /dev or anything else) " disk_choice
|
|||||||
disk="/dev/$disk_choice"
|
disk="/dev/$disk_choice"
|
||||||
clear
|
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)"
|
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"
|
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)"
|
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"
|
sha256sum "$img_name" | tee -a "$img_name.sha256"
|
||||||
|
|
||||||
### commented out in favor of pishrink
|
# pishrink
|
||||||
# webhook "xz compressing raw $img_name.xz (Script Has Run $SECONDS Seconds)"
|
## -v verbose
|
||||||
# xz -v "$img_name" | tee -a "$log" # yieldds throwaway_image_raw_dd_img_14052026.img.xz
|
## -r use advanced filesystem repair option if the normal one fails
|
||||||
|
## -Z xz compression
|
||||||
# if [ -f "$img_name" ]; then
|
## -a compress using multiple cores
|
||||||
# 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
|
|
||||||
webhook "doing pishrink from $img_name ($disk) to $img_name.xz (Script Has Run $SECONDS Seconds)"
|
webhook "doing pishrink from $img_name ($disk) to $img_name.xz (Script Has Run $SECONDS Seconds)"
|
||||||
pishrink -v -r -Z -a "$img_name"
|
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)"
|
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"
|
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)"
|
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)"
|
||||||
@@ -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"
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
port=3389
|
port=3389
|
||||||
|
|
||||||
if systemctl is-active --quiet xrdp; then
|
if systemctl is-active --quiet xrdp; then
|
||||||
echo "Running XRDP Service Found Running, Stopping..."
|
echo "Running XRDP Service Found Running, Stopping..."
|
||||||
sudo systemctl stop xrdp && echo "OK! XRDP Stopped!" || echo "ERROR: XRDP Failed To Start! Retcode: $?"
|
sudo systemctl stop xrdp && echo "OK! XRDP Stopped!" || echo "ERROR: XRDP Failed To Start! Retcode: $?"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if systemctl is-active --quiet lightdm; then
|
if systemctl is-active --quiet lightdm; then
|
||||||
echo "Window Manager Found Running, Stopping It..."
|
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
|
sudo systemctl stop lightdm && "OK! lightdm Stopped!" || echo "ERROR! Lightdm Did Not Stop! Retcode $?" # lightdm is xfce default
|
||||||
fi
|
fi
|
||||||
@@ -15,8 +15,7 @@ echo "Starting XRDP..."
|
|||||||
sudo systemctl start xrdp && echo "OK! XRDP Running!" || echo "ERROR: XRDP Failed To Start Retcode: $?"
|
sudo systemctl start xrdp && echo "OK! XRDP Running!" || echo "ERROR: XRDP Failed To Start Retcode: $?"
|
||||||
|
|
||||||
echo "Starting Window Manager..."
|
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 "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"
|
||||||
|
|
||||||
Reference in New Issue
Block a user