#!/bin/sh ######################################################################### # # FILE : writeimage # DATE : 28.11.1999 # AUTHOR : Patrick Meier / patrick.meier@gmx.net # DESCRIPTION : write a image on a cd # # Copyrigth (C) 2001 by Patrick Meier, Switzerland # ######################################################################### PN=`basename "$0"` SCSI_BUS=0 SCSI_ID=5 SCSI_LUN=0 SPEED=1 ######################################################################### # Usage ######################################################################### Usage() { echo "$PN - write a image on a cd" echo "usage: $PN [ data | audio ] imagename" echo "Please check the settings: SCSI-BUS:$SCSI_BUS / ID:$SCSI_ID / LUN:$SCSI_LUN / SPEED:$SPEED" exit 1 } ######################################################################### # main ######################################################################### while [ $# -gt 0 ] do case "$1" in --help) Usage; exit 1;; -h) Usage; exit 1;; *) break;; esac shift done [ $# -lt 2 ] && Usage && exit 1 if [ -z $SPEED ] || [ -z $SCSI_BUS ] || [ -z $SCSI_ID ] || [ -z $SCSI_LUN ] then echo "You must specify the variables in the script. The following Drives are possible" cdrecord -scanbus exit fi echo "==> writing $1-image $2 [ speed=$SPEED / $SCSI_BUS,$SCSI_ID,$SCSI_LUN ]" echo "please wait..." cdrecord -v speed=$SPEED dev=$SCSI_BUS,$SCSI_ID,$SCSI_LUN -$1 $2 ######################################################################### # EOF #########################################################################