void-packages/srcpkgs/clockspeed/files/clockspeed_adjust/clock_adjust.sh
classabbyamp 9ab1405894
*: remove unnecessary execute permissions
* INSTALL scripts don't need to be executable
* anything installed by vbin is set to 755
* many of these files were otherwise marked executable in the template
  (vinstall, chmod, etc)
* some had no business being executable, like the smattering of patches
  and other files
* remove files from chroot-distcc no longer used in the template
  (46ce787b63)
2024-08-02 13:24:47 -04:00

26 lines
594 B
Bash

#!/bin/sh
# from http://thedjbway.b0llix.net/clocksd/index.html
#
# clock_adjust.sh
# periodically get timing mark for clockspeed service
# initialize WAIT, WAIT_MAX:
WAIT=541
WAIT_MAX=2617923
# loop indefinitely
while :
do
# obtain timing mark for calibrating clockspeed adjust:
clockctl mark
# log current "attoseconds":
clockctl atto
echo "==="
echo "Waiting ${WAIT} seconds until next adjustment..."
sleep ${WAIT}
# increment $WAIT:
WAIT=`expr ${WAIT} + ${WAIT} + ${WAIT}`
if [ ${WAIT} -gt ${WAIT_MAX} ] ; then
WAIT=${WAIT_MAX}
fi
done