FreeNAS Code
This project has moved to github - see https://github.com/freenas
Brought to you by:
cochard,
mattolander
#!/bin/sh # /etc/rc.initial # part of m0n0wall (http://neon1.net/m0n0wall) # Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>. # All rights reserved. # Modified for FreeNAS (http://www.freenas.org) by Olivier Cochard-Labbe <olivier@freenas.org> # Some lines on this file are taken from pfSense (http://www.pfsense.com/) by Scott Ullrich . /etc/rc.subr . /etc/configxml.subr # Make sure the user can't kill us by pressing Ctrl-C trap : 2 trap : 3 trap : 4 # Set our operating platform PLATFORM=`cat /etc/platform` # Redirect input/output #exec </dev/console >/dev/console 2>/dev/console # Check if console menu is disabled. if configxml_isset "//system/disableconsolemenu"; then while : ; do echo echo echo "*** Console menu disabled. ***" echo read tmp done else # endless loop while : ; do # display menu echo echo echo "Console setup" echo "-------------" #echo "0) Logout (SSH only)" echo "1) Assign interfaces" echo "2) Set LAN IP address" echo "3) Reset WebGUI password" echo "4) Reset to factory defaults" echo "5) Ping host" echo "6) Shell" echo "7) Reboot system" echo "8) Shutdown system" if [ "$PLATFORM" = "i386-liveCD" ] || [ "$PLATFORM" = "amd64-liveCD" ]; then echo "9) Install/Upgrade to hard drive/flash device, etc." fi echo read -p "Enter a number: " opmode # see what the user has chosen case ${opmode} in 0) exit && exit && logout ;; 1) /etc/rc.initial.setports ;; 2) /etc/rc.initial.setlanip ;; 3) /etc/rc.initial.password ;; 4) /etc/rc.initial.defaults ;; 5) /etc/rc.initial.ping ;; 6) exit ;; 7) /etc/rc.initial.reboot ;; 8) /etc/rc.initial.halt ;; 9) /etc/rc.initial.install ;; esac done fi