Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

customize.sh: Add 10s timeout for Kernel Download. #84

Merged
merged 2 commits into from
Jan 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions customize.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,24 @@ ui_print "- Make sure you have a good internet connection."
ui_print "- [ Vol UP(+): Yes ]"
ui_print "- [ Vol DOWN(-): No ]"

START_TIME=$(date +%s)
while true ; do
getevent -lc 1 2>&1 | grep KEY_VOLUME > $TMPDIR/events
if $(cat $TMPDIR/events | grep -q KEY_VOLUMEUP) ; then
ui_print "- It will take a while...."
NOW_TIME=$(date +%s)
timeout 1 getevent -lc 1 2>&1 | grep KEY_VOLUME > "$TMPDIR/events"
if [ $(( NOW_TIME - START_TIME )) -gt 9 ] ; then
ui_print "- No input detected after 10 seconds"
ui_print "- Downloading Kernel Anyway...."
/data/adb/box/scripts/box.tool all
break
elif $(cat $TMPDIR/events | grep -q KEY_VOLUMEDOWN) ; then
ui_print "- Skip download Kernel and Geox"
break
else
if $(cat $TMPDIR/events | grep -q KEY_VOLUMEUP) ; then
ui_print "- It will take a while...."
/data/adb/box/scripts/box.tool all
break
elif $(cat $TMPDIR/events | grep -q KEY_VOLUMEDOWN) ; then
ui_print "- Skip download Kernel and Geox"
break
fi
fi
done

Expand Down