Repository 32bit  Forum
Repository 64bit  Wiki

Etna

Da Slacky.eu.

Descrizione

Script bash per la gestione del masterizzatore, supporta tutte le principali funzioni (sessioni multiple, immagini iso, cd audio, mp3, etc.).

Script

#!/bin/bash

# Etna 1.0
# by davide aka bash 2005
# http://neutronstar.cjb.net
#
# DESCRIPTION
#
# Bash script for cd-writing tasks.
# Supports all basic functions (multiple sessions, iso images, audio cd, mp3, ...).
# Requires cdrtools, lame, mpg321, sudo.
#
# LICENCE
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.


####### CONFIGURATION #######
DEV="/dev/hdc" # DEV="ATAPI:0,0,0" for a 2.4 kernel
CDREADER="/dev/hdc"
SPEED="24"
BURNDIR="$HOME/temp"
#############################

while [ 1==1 ]; do

clear
echo
echo "-- Etna 1.0"
echo "-- by davide aka bash 2005"
echo "-- http://neutronstar.cjb.net"
echo
echo " a) Quick blank CDRW"
echo " b) Complete blank CDRW"
echo " c) CD -> ISO file"
echo " d) Burn ISO"
echo " e) Burn single session"
echo " f) Burn 1st session"
echo " g) Add session"
echo " h) Extract WAV from AUDIO CD"
echo " i) Create AUDIO CD from WAV"
echo " j) Create 128 kbps MP3 from WAV"
echo " k) Create WAV from MP3"
echo " l) Resample MP3 at 64kbps"
echo " q) Quit"
echo

read -s -n1 -p "Choose..." CHOICE

case "$CHOICE" in

"a")
sudo cdrecord -v dev=$DEV blank=fast
;;

"b")
sudo cdrecord -v dev=$DEV blank=all
;;

"c")
echo
read -p "File name? "  FILENAME
# dd if=$CDREADER of=$FILENAME
readcd dev=$DEV f=$FILENAME
;;

"d")
echo
read -p "File name? "  FILENAME
sudo cdrecord -v dev=$DEV speed=$SPEED -data -dao $FILENAME
rm -i $FILENAME
;;

"e")
echo
read -p "Source Directory [$BURNDIR]? " SOURCEDIR
if [[ "$SOURCEDIR" = "" ]]; then
 SOURCEDIR="$BURNDIR"
fi
mkisofs -R -J $SOURCEDIR | sudo cdrecord -v dev=$DEV speed=$SPEED -data -
exit
;;

"f")
echo
read -p "Source Directory [$BURNDIR]? " SOURCEDIR
if [[ "$SOURCEDIR" = "" ]]; then
 SOURCEDIR="$BURNDIR"
fi
mkisofs -R -J $SOURCEDIR | sudo cdrecord -v dev=$DEV speed=$SPEED -multi -data -
exit
;;

"g")
echo
read -p "Source Directory [$BURNDIR]? " SOURCEDIR
if [[ "$SOURCEDIR" = "" ]]; then
 SOURCEDIR="$BURNDIR"
fi
mkisofs -R -J -C `sudo cdrecord dev=$DEV -msinfo` -M $DEV $SOURCEDIR | sudo cdrecord -v dev=$DEV speed=$SPEED -multi -data -
;;

"h")
read -p "BaseName? " BASENAME
cdda2wav dev=$DEV -H -B $BASENAME
;;
  
"i")
sudo cdrecord -v -pad dev=$DEV speed=$SPEED -dao *.wav
rm -i *.wav
;;

"j")
for i in *.wav; do lame -h "$i" "${i%.wav}.mp3"; done
rm -i *.wav
;;

"k")
for i in *.mp3; do mpg321 "$i" -w "${i%.mp3}.wav"; done
# for i in *.mp3; do lame --decode "$i" "$i.wav"; done
echo "Press ENTER"
read
;;

"l")
for i in *.mp3; do lame -h -b 64 "$i"; done
;;

"q")
echo
exit
;;
 
esac

done
  • Dipendenze: cdrtools, lame, mpg321, sudo.
  • Data: 03 Jun 2006
  • Autore: Bash
  • Versione: 1.0
Strumenti personali
Namespace

Varianti