From 5c105d9f3fd086aff195d3849dcf847d6b0bd927 Mon Sep 17 00:00:00 2001 From: blogic Date: Fri, 5 Oct 2012 10:12:53 +0000 Subject: branch Attitude Adjustment git-svn-id: svn://svn.openwrt.org/openwrt/branches/attitude_adjustment@33625 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/base-files/files/bin/ipcalc.sh | 62 ++++++++++++++++++++++++++++++++++ package/base-files/files/bin/login.sh | 19 +++++++++++ 2 files changed, 81 insertions(+) create mode 100755 package/base-files/files/bin/ipcalc.sh create mode 100755 package/base-files/files/bin/login.sh (limited to 'package/base-files/files/bin') diff --git a/package/base-files/files/bin/ipcalc.sh b/package/base-files/files/bin/ipcalc.sh new file mode 100755 index 000000000..d6ef16870 --- /dev/null +++ b/package/base-files/files/bin/ipcalc.sh @@ -0,0 +1,62 @@ +#!/bin/sh + +awk -f - $* <limit) end=limit + + print "IP="int2ip(ipaddr) + print "NETMASK="int2ip(netmask) + print "BROADCAST="int2ip(broadcast) + print "NETWORK="int2ip(network) + print "PREFIX="32-bitcount(compl(netmask)) + + # range calculations: + # ipcalc + + if (ARGC > 3) { + print "START="int2ip(start) + print "END="int2ip(end) + } +} +EOF diff --git a/package/base-files/files/bin/login.sh b/package/base-files/files/bin/login.sh new file mode 100755 index 000000000..04b3fe250 --- /dev/null +++ b/package/base-files/files/bin/login.sh @@ -0,0 +1,19 @@ +#!/bin/sh +# Copyright (C) 2006-2011 OpenWrt.org + +if ( ! grep -qs '^root:[!x]\?:' /etc/shadow || \ + ! grep -qs '^root:[!x]\?:' /etc/passwd ) && \ + [ -z "$FAILSAFE" ] +then + echo "Login failed." + exit 0 +else +cat << EOF + === IMPORTANT ============================ + Use 'passwd' to set your login password + this will disable telnet and enable SSH + ------------------------------------------ +EOF +fi + +exec /bin/ash --login -- cgit v1.2.3