MountExternalMemory


#!/bin/sh

# Loads the modules for ext2 if not yet done,
# and mounts the 1-st partition of the 1-st SCSI device found.
# The latter may be a CF card or an USB stick, too.

# This script was written by Stephan Seidl in 2012, no copyright is claimed.
# It is offered as-is, without any warranty.
# This script is in the public domain; do with it what you wish.

unset LANG LC_ALL
LC_ALL=C
export LC_ALL

for m in mbcache ext2 ; do
  grep -q "^${m} " /proc/modules || insmod ${m}
  done

test -d /tmp/mnt || mkdir /tmp/mnt

grep -q "^/dev/sda1 /tmp/mnt " /proc/mounts || mount -o ro /dev/sda1 /tmp/mnt


Stephan K.H. Seidl