periodic: replace "tty" with "test -t 0"
Apparently using tty for this purpose has been deprecated since 4.4 Lite.
can this be if [ -t 0] ?
test fork()s and exec()s a new process whereas [ performs the test within the shell, saving a fork() & exec().
Use [ instead of test
Sorry for missing this before but there is nothing between this else end endif. Did you mean
or unset PERIODIC_IS_INTERACTIVE
Oh, crap, I meant to delete that. It was only there for debugging purposes.
Remove debugging detritus