#!/bin/bash

# # # # # # # # # # # # # # # #
# ipcop lsusb addon installer 
# 
# (or @ corz.org 2005
#

OPTION="$1"

# install..
inst() {
	cp -p lsusb /sbin/
	cp -p usb.ids /usr/share/
}

# uninstall..
unst() {
	rm /sbin/lsusb
	rm /usr/share/usb.ids
}

# errors
err() {
	echo
	echo " error: $1 "
	options
	exit;
}

# helpful text
options() {
	echo
	echo " choose one of the following options.."
	echo
	echo "  ./install -i       to install"
	echo "  ./install -u       to uninstall"
	echo
}

case $OPTION in

	 -h|h|help|-help)
		echo
		echo " install help.."
		options;;

	 -i|i|install)
		echo
		echo " installing.."
		inst
		echo " success!!!"
		echo;;

	-u|u|uninstall)
		echo
		echo " uninstalling.."
		unst
		echo " success!"
		echo;;
	*)
	err "unrecognised option!";;
esac

sync
exit 0
