#!/bin/sh ORG="insmod epxa_wdt$" NEW="insmod epxa_wdt margin=10" FILE="/etc/init.d/rcS" TMPFILE="/tmp/F$$" grep "$ORG" $FILE > /dev/null 2>&1 if [ $? -ne 0 ]; then echo "Could not find line \"$ORG\" in $FILE to modify" exit 1 fi sed "s/${ORG}/${NEW}/" $FILE > $TMPFILE if [ $? -ne 0 ]; then echo "replace failed, $FILE untouched" exit 1 fi mv $TMPFILE $FILE chmod 755 $FILE exit 0