#!/bin/sh #-- # Creates symbolic links from some /etc files to their windows equivalents # # Version: 0.5 # # ChangeLog: # v0.5 Igor Pechtchanski : # Move FILES to top; removed VERBOSE (thx Paul Johnston) # Print messages on abnormal exit # v0.4 Igor Pechtchanski : # Use $SYSTEMROOT and $WINDIR to determine the OS (thx Warren Young) # Check for existence of $WINETC directory (thx Paul Johnston) # Use `expr substr` instead of `echo | sed` (thx Joe Buehler) # v0.3 Igor Pechtchanski : # Quote variable references (thx Joe Buehler) # Use `cygpath -W` instead of "$SYSTEMROOT" (thx Corinna Vinschen) # Change protocol to protocols on cygwin # Add ChangeLog # v0.2 Igor Pechtchanski : # Use `uname -s` instead of "$OS" # Add Win9x support # Add networks file # v0.1 Paul Johnston : # Initial version #-- FILES="hosts protocols services networks" WINHOME=`/bin/cygpath -W` if [ -n "$SYSTEMROOT" ] then WINETC="$WINHOME/system32/drivers/etc" elif [ -n "$WINDIR" ] then WINETC="$WINHOME" else echo "Unknown system type; exiting" >&2 exit 0 fi if [ ! -d "$WINETC" ] then echo "Directory $WINETC does not exist; exiting" >&2 exit 0 fi for FILE in $FILES do if [ ! -e "/etc/$FILE" ] then # Windows only uses the first 8 characters WFILE=`expr substr "$FILE" 1 8` /bin/ln -s -v "$WINETC/$WFILE" "/etc/$FILE" fi done