1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
#!/bin/bash
if [ $# -lt 1 ] || [ "${1%elp}" = "-h" ] || [ "${1%elp}" = "--h" ] ; then
echo "\
Usage: ${0##*/} [-h] karma_mount_point
For a RK mounted on karma_mount_point, uses karma_helper
to create the file karma_mount_point/device_settings.
This file contains the Rio Karma serial number needed for
properly setting the local cache ~/.openrio/pearl-serialNo/fileinfo
"
exit 0
fi
#
TMP=${TMPDIR:-/tmp}/${0##*/}.$$ ; trap "rm $TMP* 2>/dev/null" EXIT
PATH=$PATH:.
#
umount $1
karma_helper -u
karma_helper -l
karma_helper -r
karma_helper -i | sed '/^ *$/d' > $TMP
karma_helper -b
#
echo -n Mounting the RK on $1" "
while ! mount $1 2>/dev/null ; do sleep 1 ; echo -n \. ; done
echo " "mounted!
echo Creating $1/device_settings
#
cp $TMP $1/device_settings
|