Menu

[r10367]: / legacy / etc / rc.initial  Maximize  Restore  History

Download this file

91 lines (82 with data), 1.8 kB

#!/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
# Make sure the user can't access rootshell by pressing Ctrl-Z
trap : 18

# 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
		printf "\n\n\33[31m%s\33[0m\n\n"  "*** Console menu disabled. ***"
		read tmp
	done
else
	# endless loop
	while : ; do
		# display menu
		echo
		echo
		echo "Console setup"
		echo "-------------"
		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"
		case ${PLATFORM} in
			*-live[cC][dD])
				echo "9) Install/Upgrade to hard drive/flash device, etc.";;
		esac

		echo
		read -p "Enter a number: " opmode

		# see what the user has chosen
		case ${opmode} in
			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)
				case ${PLATFORM} in
					*-live[cC][dD])
						/etc/rc.initial.install
				esac
				;;
		esac
	done
fi
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.