Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | ### BEGIN INIT INFO |
| 3 | # Provides: bootmisc |
| 4 | # Required-Start: $local_fs mountvirtfs |
| 5 | # Required-Stop: $local_fs |
| 6 | # Default-Start: S |
| 7 | # Default-Stop: 0 6 |
| 8 | # Short-Description: Misc and other. |
| 9 | ### END INIT INFO |
| 10 | |
| 11 | . /etc/default/rcS |
| 12 | # |
| 13 | # Put a nologin file in /etc to prevent people from logging in before |
| 14 | # system startup is complete. |
| 15 | # |
| 16 | if test "$DELAYLOGIN" = yes |
| 17 | then |
| 18 | echo "System bootup in progress - please wait" > /etc/nologin |
| 19 | cp /etc/nologin /etc/nologin.boot |
| 20 | fi |
| 21 | |
| 22 | # |
| 23 | # Set pseudo-terminal access permissions. |
| 24 | # |
| 25 | if test -c /dev/ttyp0 |
| 26 | then |
| 27 | chmod 666 /dev/tty[p-za-e][0-9a-f] |
| 28 | chown root:tty /dev/tty[p-za-e][0-9a-f] |
| 29 | fi |
| 30 | |
| 31 | # |
| 32 | # Apply /proc settings if defined |
| 33 | # |
| 34 | SYSCTL_CONF="/etc/sysctl.conf" |
| 35 | if [ -f "${SYSCTL_CONF}" ] |
| 36 | then |
| 37 | if [ -x "/sbin/sysctl" ] |
| 38 | then |
| 39 | # busybox sysctl does not support -q |
| 40 | VERBOSE_REDIR="1>/dev/null" |
| 41 | if [ "${VERBOSE}" != "no" ]; then |
| 42 | VERBOSE_REDIR="1>&1" |
| 43 | fi |
| 44 | eval /sbin/sysctl -p "${SYSCTL_CONF}" $VERBOSE_REDIR |
| 45 | else |
| 46 | echo "To have ${SYSCTL_CONF} applied during boot, install package <procps>." |
| 47 | fi |
| 48 | fi |
| 49 | |
| 50 | # |
| 51 | # Update /etc/motd. |
| 52 | # |
| 53 | if test "$EDITMOTD" != no |
| 54 | then |
| 55 | uname -a > /etc/motd.tmp |
| 56 | sed 1d /etc/motd >> /etc/motd.tmp |
| 57 | mv /etc/motd.tmp /etc/motd |
| 58 | fi |
| 59 | |
| 60 | # |
| 61 | # This is as good a place as any for a sanity check |
| 62 | # |
| 63 | # Set the system clock from hardware clock |
| 64 | # If the timestamp is more recent than the current time, |
| 65 | # use the timestamp instead. |
| 66 | test -x /etc/init.d/hwclock.sh && /etc/init.d/hwclock.sh start |
| 67 | if test -e /etc/timestamp |
| 68 | then |
| 69 | SYSTEMDATE=`date -u +%4Y%2m%2d%2H%2M%2S` |
| 70 | read TIMESTAMP < /etc/timestamp |
| 71 | if [ ${TIMESTAMP} -gt $SYSTEMDATE ]; then |
| 72 | # format the timestamp as date expects it (2m2d2H2M4Y.2S) |
| 73 | TS_YR=${TIMESTAMP%??????????} |
| 74 | TS_SEC=${TIMESTAMP#????????????} |
| 75 | TS_FIRST12=${TIMESTAMP%??} |
| 76 | TS_MIDDLE8=${TS_FIRST12#????} |
| 77 | date -u ${TS_MIDDLE8}${TS_YR}.${TS_SEC} |
| 78 | test -x /etc/init.d/hwclock.sh && /etc/init.d/hwclock.sh stop |
| 79 | fi |
| 80 | fi |
| 81 | : exit 0 |