Sophie

Sophie

distrib > Mandriva > 2009.1 > x86_64 > media > main-release-src > by-pkgid > 9196e50c48d1a85209a51d2710ec66cd > files > 2

gnome-volume-manager-2.24.1-1mdv2009.1.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