Sophie

Sophie

distrib > Mandriva > 2009.0 > x86_64 > media > main-testing-src > by-pkgid > 285d2147a4002f1ad8650cc2bf5b79c2 > files > 2

gnome-volume-manager-2.24.0-3mdv2009.0.src.rpm

#!/bin/sh
#get the application to use from gnome-volume-manager
CMD=`/usr/bin/gconftool-2 -g "/desktop/gnome/volume_manager/autoplay_cda_command"`

#sanitize the device by stripping out the cdda:// protocol
#and escaping forward slashes
DEVICE=`echo $1 | /bin/sed -e "s/^cdda:\/\///"`
DEVICE=`echo $DEVICE | /bin/sed -e "s/%/%25/g"`
DEVICE=`echo $DEVICE | /bin/sed -e "s#/#%2f#g"`

#expand the command by replacing %d with the device and unescape it
EXPANDED_CMD=`echo $CMD | /bin/sed -e "s/%d/$DEVICE/"`
EXPANDED_CMD=`echo $EXPANDED_CMD | /bin/sed -e "s#%2f#/#g"`
EXPANDED_CMD=`echo $EXPANDED_CMD | /bin/sed -e "s/%25/%/g"`

#run the command
$EXPANDED_CMD