Annotation of elwix/config/etc/rc.initial, revision 1.1.1.1
1.1 misho 1: #!/bin/sh
2: #
3: # ELWIX Initial RC script
4: #
5: # $Id:$
6: #
7:
8: trap : 2
9: trap : 3
10: trap : 18
11: #exec </dev/console >/dev/console 2>/dev/console
12: MAGIC_MENU="unhide menu, now!"
13:
14: menu()
15: {
16: echo
17: echo
18: echo "elwix - console setup"
19: echo "*********************"
20: echo "0) Logout"
21: echo "1) Interfaces: assign network ports"
22: echo "2) Set up LAN IP address"
23: echo "3) Reset webGUI password"
24: echo "4) Reset to factory defaults"
25: echo "5) Reboot system"
26: echo "6) Ping host"
27: echo "7) SSH to host"
28: echo "8) Go to shell"
29: [ -r /etc/platform ] && PLATFORM=$(cat /etc/platform)
30: if [ "${PLATFORM}" != "embedded" ]; then
31: echo "9) Install on Hard Drive $PLATFORM";
32: fi
33: echo
34:
35: read -p "Enter number: " opcode
36:
37: case ${opcode} in
38: 0)
39: exit
40: ;;
41: 1)
42: ;;
43: 2)
44: ;;
45: 3)
46: ;;
47: 4)
48: ;;
49: 5)
50: reboot
51: ;;
52: 6)
53: read -p " +Address: " host
54: read -p " +Number packets [4]: " cx
55: ping -n -c ${cx:-4} ${host:-localhost}
56: ;;
57: 7)
58: read -p " +Address: " host
59: read -p " +Port [22]: " port
60: read -p " +User [$USER]: " user
61: ssh -p ${port:-22} -l ${user:-$USER} ${host:-localhost}
62: ;;
63: 8)
64: $SHELL
65: ;;
66: 9)
67: ;;
68: esac
69: }
70:
71: ### main()
72:
73: while : ; do
74: if [ -r /etc/disablemenu ]; then
75: echo
76: echo
77: echo "*** Console menu disabled. ***"
78: echo
79:
80: stty -echo
81: read tmp
82: stty echo
83: if [ X"${tmp}" = X"${MAGIC_MENU}" ]; then
84: echo
85: echo "> OK, temporary unhide menu ..."
86: echo
87:
88: menu
89: fi
90: else
91: menu
92: fi
93: done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>