summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorncopa <ncopa@f176ef85-8d20-0410-844a-e957b5a1c371>2008-01-22 09:20:55 +0000
committerncopa <ncopa@f176ef85-8d20-0410-844a-e957b5a1c371>2008-01-22 09:20:55 +0000
commit6e70be6533a2fc927e348977898c4ca0a4b161a9 (patch)
tree85ed5bedcea534dd839580775d439c2184de339c
parent9eb240b7f946b4453eb60c15f74c611c36a3c36c (diff)
downloadalpine-baselayout-6e70be6533a2fc927e348977898c4ca0a4b161a9.tar.bz2
alpine-baselayout-6e70be6533a2fc927e348977898c4ca0a4b161a9.tar.xz
check for block or char devices rather than links only.
-rw-r--r--subdir_dev20
1 files changed, 8 insertions, 12 deletions
diff --git a/subdir_dev b/subdir_dev
index cbd931a..1cc6b03 100644
--- a/subdir_dev
+++ b/subdir_dev
@@ -21,30 +21,26 @@ if [ -n "$2" ]; then
new_name="$2"
fi
+if [ -z "$new_name" ]; then
+ new_name=$MDEV
+fi
+
case "$ACTION" in
add|"")
- if [ -L "$MDEV" ]; then
- exit 0
+ if [ ! -b "$MDEV" ] && [ ! -c "$MDEV" ]; then
+ exit
fi
mkdir -p $1
mv $MDEV $1/$new_name
if [ "$link" = 1 ] ; then
- if [ -z "$new_name" ] ; then
- ln -snf $1/$MDEV $MDEV
- else
- ln -snf $1/$new_name $MDEV
- fi
+ ln -snf $1/$new_name $MDEV
fi
;;
remove)
if [ "$link" = 1 ] ; then
rm -f $MDEV
fi
- if [ -z "$new_name" ]; then
- mv $1/$MDEV $MDEV
- else
- mv $1/$new_name $MDEV
- fi
+ mv $1/$new_name $MDEV
rmdir $1 2>/dev/null
;;
esac