Please sign in to comment.
door: remove while true loop around read
There are cases where ./ibutton dies (e.g. because of usb resets), closing the pipe to ./door, which will cause read to fail instantly. the outer while true loop caused 100% cpu usage in these cases. It is recommended to use a regular cronjob to check for ./ibutton and ./door instead and restart them as needed.
- Loading branch information...
|@@ -1,11 +1,13 @@|
|-while true; do|
|- while read REPLY; do|
|- if [ -f "/root/authorized_ibuttons/$REPLY" ]; then|
|- sleep 3|
|- echo "$REPLY" > /tmp/last_failed_ibutton|
|+# ibutton.c may die e.g. in case of USB resets. It is recommended to use|
|+# monitoring / a cronjob to restart ./ibutton | ./door if one of them is no|
|+# longer running|
|+while read REPLY; do|
|+ if [ -f "/root/authorized_ibuttons/$REPLY" ]; then|
|+ sleep 3|
|+ echo "$REPLY" > /tmp/last_failed_ibutton|