#!/bin/sh /etc/rc.common
#
# Opennet Firmware
# 
# Copyright 2010 Rene Ejury <opennet@absorb.it>
# 
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# 
#   http://www.apache.org/licenses/LICENSE-2.0
# 

START=97
start() {
    # add info to banner if not yet done
    if [ -z "$(grep 'clean_restart_log' /etc/banner)" ]; then
        echo " ----- clean this log with 'clean_restart_log' ----- " >>/etc/banner
        echo " ----- restart times: (possibly by watchdog)   ----- " >>/etc/banner
    fi

    # log every restart in banner (remove with 'clean_restart_log')
    echo " - (no time retrieved)          - system restart --- " >>/etc/banner
    sync

    [ -c /dev/watchdog ] && [ -x /sbin/watchdog ] && \
            watchdog -t 5 /dev/watchdog
}
