Skip to content

Commit

Permalink
Add backward compatible bugfix for newer versions of Busybox 'timeout'
Browse files Browse the repository at this point in the history
  • Loading branch information
aw committed Jan 19, 2021
1 parent 6b6a7b2 commit ac1e4fa
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.11.0 (2021-01-19)

* Add backward compatible bugfix for newer versions of Busybox 'timeout'

## 1.10.0 (2018-07-04)

* [bugfix] Only wipe `/etc/resolv.conf` if a domain or dns entry exists
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
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
Expand Down
6 changes: 3 additions & 3 deletions module.l
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]>") ]
11 changes: 8 additions & 3 deletions network.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -15,6 +15,7 @@ ntp_tries=0
ntptimeout=60 # seconds
ntpretry=20 # seconds
interface_tries=0
dasht="-t"

/sbin/udevadm settle --timeout=5

Expand All @@ -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
Expand Down

0 comments on commit ac1e4fa

Please sign in to comment.