eMarcel.com

Oracle Database, Fusion Middleware, Linux

Burn CD script – Nagrywanie płyt CD

  • Skrypt do nagrywania płyt CD

Burn CD’s script

#!/bin/sh

#ustawienia zmiennych
Palnica="/dev/hdc"
Obraz="/tmp/target.iso"
tmp_backup="/tmp/*.tgz"

pomoc ()
{
echo "[uzycie:] nagraj.sh [opcja] [katalogi]"
echo ""
echo "opcje:"
echo " -h wyswietla ta pomoc"
echo " -s nagrywa w single-session"
echo " -m zaczyna multisesje"
echo " -c kontynuuje multisesje z zamykaniem sesji "
echo " -o kontynuuje multisesje bez zamykania sesji"
echo " -e czysci plyte"
echo ""
exit 1
}

iso_normal ()
{
mkisofs -v -o ${Obraz} -J -r [email protected]
}
iso_multi ()
{
mkisofs -v -o ${Obraz} -J -r -C `cdrecord -msinfo dev=${Palnica}` -M ${Palnica} [email protected]
}
cdr_normal ()
{
cdrecord -v speed=10 dev=${Palnica} ${Obraz}
}
cdr_multi ()
{
cdrecord -v -multi speed=10 dev=${Palnica} ${Obraz}
}
start_multi ()
{
iso_normal [email protected] && cdr_multi
rm -f ${Obraz}
rm -f ${tmp_backup}
}
continue_multi ()
{
iso_multi [email protected] && cdr_normal
rm -f ${Obraz}

}
continue_multi_open ()
{
iso_multi [email protected] && cdr_multi
rm -f ${Obraz}
rm -f ${tmp_backup}
}
single ()
{
iso_normal [email protected] && cdr_normal
rm -f ${Obraz}
#rm -f ${tmp_backup}
}
erase ()
{
cdrecord -v blank=fast dev=${Palnica}
}
while getopts "mcoseh" Opcja
do
case $Opcja in
m) shift $((OPTIND - 1)); start_multi [email protected]; exit $? ;;
c) shift $((OPTIND - 1)); continue_multi [email protected]; exit $? ;;
o) shift $((OPTIND - 1)); continue_multi_open [email protected]; exit $? ;;
s) shift $((OPTIND - 1)); single [email protected]; exit $? ;;
e) erase; exit $? ;;
h) pomoc ;;
*) pomoc ;;
esac
done
pomoc

 

(Visited 15 times, 1 visits today)

0 Shares
Tweet
Share
+1
Share

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close