#!/bin/sh # # This script sets up a default route on the host # The default route is based on IP (ie. xxx.xxx.xxx.254) # It is assumed that the IP listed in /etc/hosts is the # primary interface for this machine. # Harry Hoffman DROUTER=${JASS_ROOT_DIR}/etc/defaultrouter HOSTS=${JASS_ROOT_DIR}/etc/hosts logMessage "Notice setting default route in /etc/defaultrouter" if [ -f ${DROUTER} ] ; then backup_file ${DROUTER} else create_a_file -m 644 -o root:sys ${DROUTER} fi if [ ! -f ${HOSTS} ] ; then logNotice "There is no host file to find IP with" else BASEADDR=`grep ${JASS_HOSTNAME} ${HOSTS}|cut -d. -f1-3` logMessage "Default Route set in /etc/defaultrouter" echo ${BASEADDR}.254 > ${DROUTER} fi