#!/bin/sh
# This script will generate a udev rule file called 86-tape.rules file which will
# modprobe ide-scsi module if a tape device is detected and a corresponding event is generated.
# Please do not change the 86-tape.rules file name unless you have a strong reason to do it.

RULES_DIR=/etc/udev/rules.d
if [ -e $RULES_DIR ] ; then
	touch $RULES_DIR/86-tape.rules
	echo "#Rule for tape devices to be emulated as scsi devices. Without this the tape devices do not get enumerated." >> $RULES_DIR/86-tape.rules
	echo 'SUBSYTEM=="ide", SYSFS{media}=="tape", ACTION=="add",  RUN+="/sbin/modprobe ide-scsi"'  >> $RULES_DIR/86-tape.rules
fi
