#!/bin/sh echo "Dreamcast Dumping Script by darcagn" echo " for use with httpd-ack gd-rom dumper software" echo " => http://dumpcast.dcemulation.org/\n" if [ -z "$1" ]; then echo "usage: dcdump.sh [dreamcast's IP address]" echo "IP of Dreamcast not specified. Quitting.\n " exit fi echo "Beginning to download files from httpd-ack...\n" wget -r -w 1 -nH -R dc_bios*,dc_flash*,syscalls*,httpd-ack* $1 echo "Required disc access complete, spinning down disc..." wget -q -t 1 -O /dev/null $1/cdrom_spin_down echo "Renaming downloaded tracks to their correct filenames..." for i in track* do mv "$i" "`echo $i | sed s/.ipbintoc.*$//`" done echo "Generating dump information...\n" echo "[b][u]Disc Information[/u]:[/b]" > postinfo.txt cat index.html \ | head -16 | tail -10 \ | sed 's//[b]/g' \ | sed 's/<\/td>/:[\/b] /g' \ | sed 's/<\/td><\/tr>//g' >> postinfo.txt rm index.html echo "GDI info...\n" printf "\nringcode:[code]<>[/code]\n\ngdi information:[code]" >> postinfo.txt cat disc.gdi | tr -d "\r" | tee -a postinfo.txt echo "[/code]\n" >> postinfo.txt printf "file information:[quote]" >> postinfo.txt echo "\nCalculating filesizes and hashes... This may take a while, please be patient.\n" printf "disc.gdi " | tee -a postinfo.txt filesize="size "`ls -nl disc.gdi | awk '{print $5}'` printf "\t$filesize\t" printf "[color=red]%s[/color] " "$filesize" >> postinfo.txt crc32="crc "`crc32 disc.gdi` printf "$crc32 " printf "[color=green]%s[/color] " "$crc32" >> postinfo.txt md5="md5 "`openssl md5 disc.gdi | awk -F"=" '{ print $2 }' | sed 's/ //g'` printf "$md5 " printf "[color=blue]%s[/color] " "$md5" >> postinfo.txt sha1="sha1"`openssl sha1 disc.gdi | awk -F"=" '{ print $2 }'` printf "%s\n" "$sha1" printf "[color=red]%s[/color]\n" "$sha1" >> postinfo.txt for track in track* do printf "$track " | tee -a postinfo.txt filesize="size "`ls -nl $track | awk '{print $5}'` printf "\t$filesize\t" printf "[color=red]%s[/color] " "$filesize" >> postinfo.txt crc32="crc "`crc32 $track` printf "$crc32 " printf "[color=green]%s[/color] " "$crc32" >> postinfo.txt md5="md5 "`openssl md5 $track | awk -F"=" '{ print $2 }' | sed 's/ //g'` printf "$md5 " printf "[color=blue]%s[/color] " "$md5" >> postinfo.txt sha1="sha1"`openssl sha1 $track | awk -F"=" '{ print $2 }'` printf "%s\n" "$sha1" printf "[color=red]%s[/color]\n" "$sha1" >> postinfo.txt done echo "[/quote]\n" >> postinfo.txt echo "\npostinfo.txt generated... all done!"