829bf6b9a1
[base-files] failsafe-mode: print short help on commandline Like mentioned in ticket https://dev.openwrt.org/ticket/11911 this should make the IRC much quieter. Failsafe is somehow special and even experienced users are helpless, because they are not used to this seldom situation. Also: likely you have no internet access in this mode, so you cannot use the wiki. a failsafe-session now looks like this: first we see from 'package/base-files/files/bin/login.sh' the hint: === IMPORTANT ============================ Use 'passwd' to set your login password this will disable telnet and enable SSH ------------------------------------------ after this the /etc/banner ("OpenWrt - wireless freedom") and then the new text: ================= FAILSAFE MODE active ================ special commands: * firstboot reset settings to factory defaults * mount_root mount root-partition with config files after mount_root: * passwd change root's password * /etc/config directory with config files for more help see: http://wiki.openwrt.org/doc/howto/generic.failsafe ======================================================= this supersedes the old patches: http://patchwork.openwrt.org/patch/3337/ http://patchwork.openwrt.org/patch/3553/ Signed-off-by: Bastian Bittorf <bittorf@bluebottle.com> SVN-Revision: 42985
17 lines
530 B
Bash
17 lines
530 B
Bash
#!/bin/sh
|
|
[ -f /etc/banner ] && cat /etc/banner
|
|
[ -e /tmp/.failsafe ] && cat /etc/banner.failsafe
|
|
|
|
export PATH=/usr/bin:/usr/sbin:/bin:/sbin
|
|
export HOME=$(grep -e "^${USER:-root}:" /etc/passwd | cut -d ":" -f 6)
|
|
export HOME=${HOME:-/root}
|
|
export PS1='\u@\h:\w\$ '
|
|
|
|
[ -x /bin/more ] || alias more=less
|
|
[ -x /usr/bin/vim ] && alias vi=vim || alias vim=vi
|
|
|
|
[ -z "$KSH_VERSION" -o \! -s /etc/mkshrc ] || . /etc/mkshrc
|
|
|
|
[ -x /usr/bin/arp ] || arp() { cat /proc/net/arp; }
|
|
[ -x /usr/bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; }
|