mountnetware

Submitted scripts and programs
Forum rules
Your own work only.
User avatar
GekkoP
Emacs Sancho Panza
Posts: 5878
Joined: Tue Sep 03, 2013 7:05 am

mountnetware

Unread post by GekkoP » Fri Apr 18, 2014 1:08 pm

I wrote this little script to help me properly mount my Samsung YP-R1. A weird device, it has different partitions in it but I can transfer both on and from it using this script.
I usually use this script first, and then go with Pidsley's script to fill the mp3 reader.

Code: Select all

#!/bin/sh
#
# Script to properly mount USB Novell Netware 386.
#
# I only use one USB key at the time, so the script
# umounts everything in /media/usb* on purpose.
# It is possible to specify a different device.

if [ ! -z $1 ]; then
    echo "you specified a device"
    check=$(fdisk -l | grep Netware | grep $1 | awk '{print $1}')
    if [ ! -z $check ]; then
	device=$1
    else
	echo "no Novel Netware 386 on "$1
	exit 1
    fi
else
    # default device
    check=$(fdisk -l | grep Netware | grep sdb | awk '{print $1}')
    if [ ! -z $check ]; then
	device="/dev/sdb"
    else
	echo "no Novel Netware 386 on /dev/sdb"
	exit 1
    fi
fi

# log device
echo "found USB Novell Netware 386 on $device"

# create /media/usb if needed
if [ ! -d "/media/usb" ]; then
    mkdir -p /media/usb
fi

# umount possible automounted devices
umount /media/usb* 2>/dev/null

# mount
mount $device /media/usb -o async,uid=1000,gid=1000,utf8,dmask=027,fmask=137

# log done
echo "$device mounted on /media/usb"

Post Reply