Minor Fixes

This commit is contained in:
2026-04-10 10:29:54 -04:00
parent 8eafb32564
commit dc69953226
2 changed files with 24 additions and 13 deletions
+13 -6
View File
@@ -80,6 +80,12 @@ cleanup () {
umount "/mnt/reinstallbackups" umount "/mnt/reinstallbackups"
umount "/mnt/decs" umount "/mnt/decs"
fi fi
if [[ ! $ticket_number =~ ^\s*$ ]];
then
umount /mnt/"$ticket_number"
else
umount "/mnt/UNKNWN"
fi
} }
trap catch_sigint SIGINT trap catch_sigint SIGINT
@@ -230,11 +236,11 @@ get_device () {
loginfo "" loginfo ""
if [[ $devicetype = "HDD_SATA" ]] || [[ $devicetype = "SSD_SATA" ]]; if [[ $devicetype = "HDD_SATA" ]] || [[ $devicetype = "SSD_SATA" ]];
then then
loginfo "$(lsblk -o NAME,SIZE,MODEL,VENDOR,ROTA | grep -E '^NAME|sda')" loginfo "$(lsblk -o NAME,SIZE,MODEL,VENDOR,ROTA | grep -E '^NAME|sd[a-z]')"
elif [[ $devicetype = "SSD_NVME" ]]; elif [[ $devicetype = "SSD_NVME" ]];
then then
pcie_enable pcie_enable
loginfo "$(lsblk -o NAME,SIZE,MODEL,VENDOR,ROTA | grep -E '^NAME|nvme')" loginfo "$(lsblk -o NAME,SIZE,MODEL,VENDOR,ROTA | grep -E '^NAME|nvme[0-9]')"
fi fi
loginfo "" loginfo ""
loginput "Which is the device from this list? (Type 'help' for help.)" loginput "Which is the device from this list? (Type 'help' for help.)"
@@ -378,9 +384,10 @@ make_infolog () {
loginfo "Windows install detected on $device$i." loginfo "Windows install detected on $device$i."
echo "Windows install detected on $device$i." >> "$infolog" echo "Windows install detected on $device$i." >> "$infolog"
echo "" >> "$infolog" echo "" >> "$infolog"
winpath=$(find /mnt/"$ticket_number" -maxdepth 4 -ipath "*System32/config" -not -ipath "*Windows.old*") winsoftwarepath=$(find /mnt/"$ticket_number" -maxdepth 4 -ipath "*System32/config/SOFTWARE" -not -ipath "*Windows.old*")
cp "$winpath/SOFTWARE" /tmp/"$ticket_number"/SOFTWARE winsystempath=$(find /mnt/"$ticket_number" -maxdepth 4 -ipath "*System32/config/SYSTEM" -not -ipath "*Windows.old*")
cp "$winpath/SYSTEM" /tmp/"$ticket_number"/SYSTEM cp "$winsoftwarepath" /tmp/"$ticket_number"/SOFTWARE
cp "$winsystempath" /tmp/"$ticket_number"/SYSTEM
CurrentVersion=$(hivexregedit --export --unsafe-printable-strings --max-depth 1 --prefix \\HKEY_LOCAL_MACHINE\\SOFTWARE /tmp/"$ticket_number"/SOFTWARE '\Microsoft\Windows NT\CurrentVersion') CurrentVersion=$(hivexregedit --export --unsafe-printable-strings --max-depth 1 --prefix \\HKEY_LOCAL_MACHINE\\SOFTWARE /tmp/"$ticket_number"/SOFTWARE '\Microsoft\Windows NT\CurrentVersion')
ComputerName=$(hivexregedit --export --unsafe-printable-strings --max-depth 1 --prefix \\HKEY_LOCAL_MACHINE\\SYSTEM /tmp/"$ticket_number"/SYSTEM '\ControlSet001\Control\ComputerName\ComputerName') ComputerName=$(hivexregedit --export --unsafe-printable-strings --max-depth 1 --prefix \\HKEY_LOCAL_MACHINE\\SYSTEM /tmp/"$ticket_number"/SYSTEM '\ControlSet001\Control\ComputerName\ComputerName')
Parameters=$(hivexregedit --export --unsafe-printable-strings --max-depth 1 --prefix \\HKEY_LOCAL_MACHINE\\SYSTEM /tmp/"$ticket_number"/SYSTEM '\ControlSet001\Services\Tcpip\Parameters') Parameters=$(hivexregedit --export --unsafe-printable-strings --max-depth 1 --prefix \\HKEY_LOCAL_MACHINE\\SYSTEM /tmp/"$ticket_number"/SYSTEM '\ControlSet001\Services\Tcpip\Parameters')
@@ -401,7 +408,7 @@ make_infolog () {
echo "$LogonUI" | grep -E '"LastLoggedOnDisplayName"=str\(1\):".+"' | sed -E 's/"LastLoggedOnDisplayName"=str\(1\):"(.+)"/Last Logged On User: \1/' echo "$LogonUI" | grep -E '"LastLoggedOnDisplayName"=str\(1\):".+"' | sed -E 's/"LastLoggedOnDisplayName"=str\(1\):"(.+)"/Last Logged On User: \1/'
echo "$ProfileList" | grep -E '"ProfileImagePath"=str\(2\):".+"' | sed -E 's/"ProfileImagePath"=str\(2\):"(.+)"/User: \1/' echo "$ProfileList" | grep -E '"ProfileImagePath"=str\(2\):".+"' | sed -E 's/"ProfileImagePath"=str\(2\):"(.+)"/User: \1/'
echo "" echo ""
tree -a -L 1 -D "$(find /mnt/"$ticket_number"/ -maxdepth 2 -type d -ipath "*/Users" -not -ipath "*Windows.old*")" tree -a -L 1 -D "$(find /mnt/"$ticket_number"/ -maxdepth 2 -type d -ipath "*/Users" -o -ipath "*/Documents and Settings" -not -ipath "*Windows.old*" | head -1)"
echo "" echo ""
} >> "$infolog" } >> "$infolog"
else else
+10 -6
View File
@@ -67,6 +67,7 @@ cleanup () {
then then
umount "/mnt/decs" umount "/mnt/decs"
fi fi
umount "/mnt/UNKNWN"
} }
trap catch_sigint SIGINT trap catch_sigint SIGINT
@@ -161,11 +162,11 @@ get_device () {
loginfo "" loginfo ""
if [[ $devicetype = "HDD_SATA" ]] || [[ $devicetype = "SSD_SATA" ]]; if [[ $devicetype = "HDD_SATA" ]] || [[ $devicetype = "SSD_SATA" ]];
then then
loginfo "$(lsblk -o NAME,SIZE,MODEL,VENDOR,ROTA | grep -E '^NAME|sda')" loginfo "$(lsblk -o NAME,SIZE,MODEL,VENDOR,ROTA | grep -E '^NAME|sd[a-z]')"
elif [[ $devicetype = "SSD_NVME" ]]; elif [[ $devicetype = "SSD_NVME" ]];
then then
pcie_enable pcie_enable
loginfo "$(lsblk -o NAME,SIZE,MODEL,VENDOR,ROTA | grep -E '^NAME|nvme')" loginfo "$(lsblk -o NAME,SIZE,MODEL,VENDOR,ROTA | grep -E '^NAME|nvme[0-9]')"
fi fi
loginfo "" loginfo ""
loginput "Which is the device from this list? (Type 'help' for help.)" loginput "Which is the device from this list? (Type 'help' for help.)"
@@ -305,9 +306,10 @@ make_infolog () {
loginfo "Windows install detected on $device$i." loginfo "Windows install detected on $device$i."
echo "Windows install detected on $device$i." >> "$infolog" echo "Windows install detected on $device$i." >> "$infolog"
echo "" >> "$infolog" echo "" >> "$infolog"
winpath=$(find /mnt/UNKNWN -maxdepth 4 -ipath "*System32/config" -not -ipath "*Windows.old*") winsoftwarepath=$(find /mnt/UNKNWN -maxdepth 4 -ipath "*System32/config/SOFTWARE" -not -ipath "*Windows.old*")
cp "$winpath/SOFTWARE" /tmp/UNKNWN/SOFTWARE winsystempath=$(find /mnt/UNKNWN -maxdepth 4 -ipath "*System32/config/SYSTEM" -not -ipath "*Windows.old*")
cp "$winpath/SYSTEM" /tmp/UNKNWN/SYSTEM cp "$winsoftwarepath" /tmp/UNKNWN/SOFTWARE
cp "$winsystempath" /tmp/UNKNWN/SYSTEM
CurrentVersion=$(hivexregedit --export --unsafe-printable-strings --max-depth 1 --prefix \\HKEY_LOCAL_MACHINE\\SOFTWARE /tmp/UNKNWN/SOFTWARE '\Microsoft\Windows NT\CurrentVersion') CurrentVersion=$(hivexregedit --export --unsafe-printable-strings --max-depth 1 --prefix \\HKEY_LOCAL_MACHINE\\SOFTWARE /tmp/UNKNWN/SOFTWARE '\Microsoft\Windows NT\CurrentVersion')
ComputerName=$(hivexregedit --export --unsafe-printable-strings --max-depth 1 --prefix \\HKEY_LOCAL_MACHINE\\SYSTEM /tmp/UNKNWN/SYSTEM '\ControlSet001\Control\ComputerName\ComputerName') ComputerName=$(hivexregedit --export --unsafe-printable-strings --max-depth 1 --prefix \\HKEY_LOCAL_MACHINE\\SYSTEM /tmp/UNKNWN/SYSTEM '\ControlSet001\Control\ComputerName\ComputerName')
Parameters=$(hivexregedit --export --unsafe-printable-strings --max-depth 1 --prefix \\HKEY_LOCAL_MACHINE\\SYSTEM /tmp/UNKNWN/SYSTEM '\ControlSet001\Services\Tcpip\Parameters') Parameters=$(hivexregedit --export --unsafe-printable-strings --max-depth 1 --prefix \\HKEY_LOCAL_MACHINE\\SYSTEM /tmp/UNKNWN/SYSTEM '\ControlSet001\Services\Tcpip\Parameters')
@@ -328,7 +330,7 @@ make_infolog () {
echo "$LogonUI" | grep -E '"LastLoggedOnDisplayName"=str\(1\):".+"' | sed -E 's/"LastLoggedOnDisplayName"=str\(1\):"(.+)"/Last Logged On User: \1/' echo "$LogonUI" | grep -E '"LastLoggedOnDisplayName"=str\(1\):".+"' | sed -E 's/"LastLoggedOnDisplayName"=str\(1\):"(.+)"/Last Logged On User: \1/'
echo "$ProfileList" | grep -E '"ProfileImagePath"=str\(2\):".+"' | sed -E 's/"ProfileImagePath"=str\(2\):"(.+)"/User: \1/' echo "$ProfileList" | grep -E '"ProfileImagePath"=str\(2\):".+"' | sed -E 's/"ProfileImagePath"=str\(2\):"(.+)"/User: \1/'
echo "" echo ""
tree -a -L 1 -D "$(find /mnt/UNKNWN/ -maxdepth 2 -type d -ipath "*/Users" -not -ipath "*Windows.old*")" tree -a -L 1 -D "$(find /mnt/UNKNWN/ -maxdepth 2 -type d -ipath "*/Users" -o -ipath "*/Documents and Settings" -not -ipath "*Windows.old*" | head -1)"
echo "" echo ""
} >> "$infolog" } >> "$infolog"
else else
@@ -384,7 +386,9 @@ make_infolog () {
echo "END OF LOG" >> "$infolog" echo "END OF LOG" >> "$infolog"
if [[ ! $logtofile = "true" ]] if [[ ! $logtofile = "true" ]]
then then
echo "" >&3
cat "$infolog" >&3 cat "$infolog" >&3
echo "" >&3
fi fi
} }