Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- By darcagn
- "I've been buying a lot of discs lately and needed a faster way to both dump/post info and to verify that my discs are good.
- Usage: dcdump.sh [dreamcastIP]
- Features:
- [*]Downloads all tracks automatically using default dumping parameters
- [*]Spins down GD-ROM drive when dumping is completed
- [*]Prints GDI and file size/hashes to the terminal so that you can quickly compare info
- [*]Generates postinfo.txt file with everything ready to go for a perfect post here at Dumpcast. Just write in your ringcode and paste into a new post.
- Download http://dumpcast.dcemulation.org/dcdump.sh
- Script tested on OS X Mavericks, OS X Snow Leopard, and Ubuntu. On OS X, you will need to install wget first--the easiest way to do this is by using a package manager such as Homebrew, fink, or MacPorts. The hash generation code relies on OpenSSL so make sure that is installed too. Everything else should be standard on any common *nix distro.
- Comments and suggestions welcomed. I will be happy to address any cross-platform issues to get it running on your system.
- Code:#!/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/<tr><td>/[b]/g' \
- | sed 's/<\/td><td colspan=3>/:[\/b] /g' \
- | sed 's/<\/td><\/tr>//g' >> postinfo.txt
- rm index.html
- echo "GDI info...\n"
- printf "\nringcode:[code]<<write in ringcode here>>[/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!"
Add Comment
Please, Sign In to add comment