#!/bin/sh # Initialize entware-ng environment TEST_DIR="/opt/bin" OPT_DIR="/opt" MOUNT_SRC="/mnt/HD/HD_a2/entware-ng/opt" SUBDIR_LIST="bin etc lib sbin share tmp usr var include" ROOT_PROFILE="/home/root/.profile" PROFILE_SRC="/opt/etc/profile" # Create the mount point links if [ ! -d $TEST_DIR ]; then for DIR in $SUBDIR_LIST do echo "Linking $MOUNT_SRC/$DIR to $OPT_DIR/$DIR" /bin/ln -sf $MOUNT_SRC/$DIR $OPT_DIR/$DIR done fi # Update root user PATH if [ ! -f $ROOT_PROFILE ]; then echo ". $PROFILE_SRC" > $ROOT_PROFILE chmod +x $ROOT_PROFILE else if [ `grep -w -c "$PROFILE_SRC" $ROOT_PROFILE` -lt 1 ]; then echo ". $PROFILE_SRC" >> $ROOT_PROFILE chmod +x $ROOT_PROFILE fi fi # Inherit the "qnapware" environment . $ROOT_PROFILE # Start any init.d scripts in "qnapware" environment /opt/etc/init.d/rc.unslung start ping -c 3 192.168.1.254 > /dev/null RES=$? #DATE=`date +"%Y/%m/%d %H:%M:%S"` DATE=`date +"%Y/%m/%d"` echo $DATE `uptime` $RES >> /shares/Public/five_min_cron.out # Set Reboot on Kernel Panic echo 30 > /proc/sys/kernel/panic echo 1 > /proc/sys/kernel/panic_on_oops exit 0