#! /bin/sh # # $Id: makedev.unet.in,v 1.1 2001/01/25 22:03:39 mdw Exp $ # # Make usernet devices # # (c) 1998 Mark Wooding # #----- Licensing notice ----------------------------------------------------- # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #----- Revision history ----------------------------------------------------- # # $Id: makedev.unet.in,v 1.1 2001/01/25 22:03:39 mdw Exp $ # --- Configuration stuff --- unet_major=@MAJORDEV@ unet_transMinor=@TRANSMINOR@ unet_persistent=@NPERSIST@ unet_mode=600 # --- Sanity check --- case `uname -s` in [Ll]inux) ;; *) echo >&2 "$0: this program is Linux-specific" ;; esac # --- Sort out command line arguments --- while [ $# -gt 0 ]; do opt="$1"; shift; case "$opt" in # --- Help requests --- -h|-he|-hel|-help | --h|--he|--hel|--help) cat <&2 "$0: unknown option $opt"; exit 1 ;; esac done # --- Do the stuff --- rm -f /dev/unet* if [ "$unet_persistent" -gt 0 ]; then i=0 while [ "$i" -lt "$unet_persistent" ]; do mknod -m "$unet_mode" /dev/unet$i c "$unet_major" $i i=`expr $i + 1` done fi mknod -m "$unet_mode" /dev/unet c "$unet_major" "$unet_transMinor" exit 0