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

allow ^C to interrupt /etc/rc.local



Gentlemen, at the bottom of /etc/rc.local I have:
  echo "============ $0:
  Will execute \"${program=/etc/init.d/nodm start}\" in ${seconds=5} seconds.
    Hit ^C to cancel.
    Hit RET to start right away."
  for ((; seconds > 0; seconds--)); do read -p $seconds.. -t 1 && break; done
  echo running $program...
  $program
The problem is of course that ^C is ignored when running /etc/rc.local .
I have tried putting set -i, stty, trap '' INT, you name it, into
/etc/rc.local . They all don't work. The best I can do is to type
something and then a RET, and evaluate that, which is not as fun as ^C.


Reply to: