diff --git a/ogn-rf.cc b/ogn-rf.cc index c9baead..5147a09 100644 --- a/ogn-rf.cc +++ b/ogn-rf.cc @@ -1055,10 +1055,17 @@ int main(int argc, char *argv[]) GSM.Start(); RF.Start(); - char Cmd[128]; - while(!RF.StopReq) - { if(fgets(Cmd, 128, stdin)==0) break; - UserCommand(Cmd); } + if (isatty(fileno(stdin))) { + char Cmd[128]; + while(!RF.StopReq) { + if(fgets(Cmd, 128, stdin)==0) break; + UserCommand(Cmd); + } + } else { + while(!RF.StopReq) { + sleep(1); + } + } sleep(4); RF.Stop();