Menu

[r789]: / trunk / etc / rc.initial  Maximize  Restore  History

Download this file

104 lines (83 with data), 1.6 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>
# Somes lines on this file are taken from pfSense (http://www.pfsense.com/) by Scott Ullrich

# 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

if [ -r /var/etc/disableconsole ]; then

while : ; do

echo
echo
echo "*** Console menu disabled. ***"
echo

read tmp

done

#/bin/sleep 10

else

# endless loop
while : ; do

# Change permission to the / directory
chmod 711 root /

# display a cheap 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) PowerOff system"
if [ "$PLATFORM" = "generic-pc-cdrom" ]; then
    echo "9) Install to an hard drive/memory drive/USB pen, 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)
	/bin/tcsh
	;;
7)
	/etc/rc.initial.reboot
	;;
8)
	/etc/rc.initial.halt
	;;
9)
	/etc/rc.initial.install
	;;
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.