[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: allow ^C to interrupt /etc/rc.local



OK, thanks everybody. I came up with a workaround since ^C doesn't interrupt:
$ tail /etc/rc.local
echo "============ $0:
Will execute \"${program=/etc/init.d/nodm start}\" in ${seconds=5} seconds.
  Hit some chars and RET to cancel.
  Hit RET to start right away."
for ((; seconds > 0; seconds--))
do
    read -p $seconds.. -t 1
    case $? in 0) #they hit RET...
	    case $REPLY in
		'') break  ;; #...with no other chars
		*)  exit 44;; #...with other chars
	    esac;;
    esac
done
echo running $program...
$program


Reply to: