#!/bin/bash
## splitfile.sh
## v0.2: NOW TCMD COMPATIBLE! (kinda reverse-engineered ;p)
## Deps: cfv, split
if [ „$#” != „0” ]
then
alias du=’du’
alias split=’split’
alias cfv=’cfv’
alias cut=’cut’
export SESSID=$RANDOM
echo „Splitting $1… It may take a few minutes… or hours… be patient, at least less than a day is remaining ;)”
split -a3 -d -b1024m „$1” „$1”.
echo „Calculating checksum, go away and take a nap…”
cfv -C -t sfv -f /tmp/crc-„$SESSID”.sfv „$1”
echo -n „filename=” > „$1”.crc
cat /tmp/crc-„$SESSID”.sfv|tail -n1|rev|cut -d -f 2-|rev >> „$1”.crc
echo -n „size=” >> „$1”.crc
du -b „$1″|cut -f 1 >> „$1”.crc
echo -n „crc32=” >> „$1”.crc
cat /tmp/crc-„$SESSID”.sfv|tail -n1|rev|cut -d -f 1|rev >> „$1”.crc
mv /tmp/crc-„$SESSID”.sfv „$1”.sfv
echo „done”
else
echo „Usage: splitfile.sh filename”
echo „Splits „filename” into 1024M parts, then creates SFV and tcmd-compatible CRC information file.”
echo „”
exit 1
fi
legutóbbi hsz