NSLU2-Linux
view · edit · print · history

Simple OpenSlug 2.7 hotplug script for automounting USB flashdisk on port "Disk 1"

mkdir /mnt/public

mkdir /etc/hotplug.d/default

create script: vi /etc/hotplug.d/default/default.hotplug


#!/bin/sh
#
if [ "${ACTION}" = "add" ]; then
if fdisk -l | grep -q sdb; then
mount /dev/sdb1 /mnt/public
fi
elif [ "${ACTION}" = "remove" ]; then
if mount | grep -q sdb; then
umount /dev/sdb1
fi
fi

change script to executable: chmod +x /etc/hotplug.d/default/default.hotplug

view · edit · print · history · Last edited by Audrius.
Originally by Audrius.
Page last modified on May 21, 2006, at 11:13 PM