! hangup.hayes -- turns off result codes ifblind done zero flush wakemodem: count ifgtr cantwake 4 send AT\r timeout wakemodem 2000 expect turnoff0 OK turnoff0: zero turnoff: count ifgtr cantturnoff 4 sleep 1000 send ATQ1\r expect turnoff OK timeout done 1000 done: success cantturnoff: logerr Hangup: Sent ATQ1, modem still responding failed cantwake: logerr Hangup: No OK from modem, sending ATQ1 anyway send ATQ1\r success