-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add backward compatible bugfix for newer versions of Busybox 'timeout'
- Loading branch information
Showing
4 changed files
with
16 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2015-2018 Alexander Williams, Unscramble <[email protected]> | ||
Copyright (c) 2015-2021 Alexander Williams, Unscramble <[email protected]> | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
[de MODULE_INFO | ||
("name" "tinycore-network") | ||
("version" "1.9.0") | ||
("version" "1.11.0") | ||
("summary" "TinyCore static/dhcp networking") | ||
("source" "https://a1w.ca") | ||
("source" "https://on-premises.com") | ||
("author" "Alexander Williams") | ||
("license" "MIT") | ||
("copyright" "(c) 2015-2018 Alexander Williams, Unscramble <[email protected]>") ] | ||
("copyright" "(c) 2015-2021 Alexander Williams, Unscramble <[email protected]>") ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,9 +3,9 @@ | |
# TinyCore static/dhcp networking | ||
# | ||
# MIT License | ||
# Copyright (c) 2015-2018 Alexander Williams, Unscramble <[email protected]> | ||
# Copyright (c) 2015-2021 Alexander Williams, Unscramble <[email protected]> | ||
# | ||
# VERSION: 1.9.0 | ||
# VERSION: 1.11.0 | ||
|
||
. /etc/init.d/tc-functions | ||
set -a | ||
|
@@ -15,6 +15,7 @@ ntp_tries=0 | |
ntptimeout=60 # seconds | ||
ntpretry=20 # seconds | ||
interface_tries=0 | ||
dasht="-t" | ||
|
||
/sbin/udevadm settle --timeout=5 | ||
|
||
|
@@ -31,7 +32,11 @@ set_ntpdate() { | |
ntp_tries=$(( $ntp_tries + $ntpretry )) | ||
if [ "$ntp_tries" -le "$ntptimeout" ]; then | ||
echo -n "." | ||
/usr/bin/timeout -t $ntpretry /usr/sbin/ntpd -d -n -q -p "$ntpserver" >>/var/log/ntp.log 2>&1 || set_ntpdate | ||
/usr/bin/timeout 2>&1 | grep -q '\-t SECS' | ||
if [ "$?" = 1 ]; then | ||
dasht="" | ||
fi | ||
/usr/bin/timeout "$dasht" $ntpretry /usr/sbin/ntpd -d -n -q -p "$ntpserver" >>/var/log/ntp.log 2>&1 || set_ntpdate | ||
else | ||
return 1 | ||
fi | ||
|