#!/sbin/runscript # Copyright 2005 theSoul thesoulru ~ gmail ~ com # Distributed under the terms of the GNU General Public License v2 depend() { need localmount } checkconfig() { if [ ! -e "/dev/pktcdvd" ]; then /sbin/modprobe pktcdvd &> /dev/null if [ ! -e "/dev/pktcdvd" ]; then eerror "There is no support for packet writing in your kernel" eerror "Rebuild kernel with packet writing support and try again" return 1 fi fi if [ ! -e "/etc/conf.d/pktcdvd" ]; then eerror "You must create config file /etc/conf.d/pktcdvd" eerror "Just run \`echo drives=\\\"/dev/your_cdrw_1 /dev/your_cdrw_2\\\" > /etc/conf.d/pktcdvd'" return 1 else . /etc/conf.d/pktcdvd fi } start() { checkconfig || return 1 ebegin "Enabling packet mode on CD/DVD writers" local j=0 for i in ${drives} do /usr/bin/pktsetup pktcdvd${j} ${i} &> /dev/null if [ -e /dev/pktcdvd${j} ]; then einfo " /dev/pktcdvd${j} ---> $i" else ewarn " Error enabling packet mode on ${i}" fi j=$((${j} + 1)) done eend 0 } stop() { checkconfig || return 1 ebegin "Disabling packet mode on CD/DVD writers" local j=0 for i in ${drives} do if [ ! -e /dev/pktcdvd${j} ]; then ewarn " Packet mode on ${i} not enabled. Skipping" continue fi /usr/bin/pktsetup -d pktcdvd${j} &> /dev/null if [ ! -e /dev/pktcdvd${j} ]; then einfo " /dev/pktcdvd${j} -X-> $i" else ewarn " Error disabling packet mode on ${i}" fi j=$((${j} + 1)) done eend 0 }