From ef337b9cba5f8a3327766abd391f496b55d4793e Mon Sep 17 00:00:00 2001 From: TheGroundZero <2406013+TheGroundZero@users.noreply.github.com> Date: Fri, 30 Jun 2023 08:55:57 +0000 Subject: [PATCH 1/4] Update update Add file existence checks to reduce error messages in output. Use filters for zic processing to reduce error messages in output. --- server/update | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/server/update b/server/update index 944614e..56807df 100755 --- a/server/update +++ b/server/update @@ -1,21 +1,33 @@ #!/bin/sh -rm -rf ~timezoned/download -mkdir ~timezoned/download +cd ~timezoned -rm -rf ~timezoned/zoneinfo -mkdir ~timezoned/zoneinfo +# Clear work environment +if [ -e "download" ]; then rm -rf download; fi +mkdir download +if [ -e "zoneinfo" ]; then rm -rf zoneinfo; fi +mkdir zoneinfo + +# Download TZ data cd ~timezoned/download wget ftp://ftp.iana.org/tz/tzdata-latest.tar.gz tar zxvf tzdata-latest.tar.gz rm tzdata-latest.tar.gz -for i in `ls`; do zic -d ~timezoned/zoneinfo $i;done -rm ~timezoned/posixinfo +# Process TZ data + +for f in `grep -l "# tzdb data" *`; do zic -d ~timezoned/zoneinfo $f; done +zic -d ~timezoned/zoneinfo backward +# POSIX info cd ~timezoned/zoneinfo + +if [ -e "posixinfo" ]; then + rm posixinfo + touch posixinfo + for i in `find *|grep /` do if [ -f $i ]; then From 03585b17c7593afd885587dc00b247dc87909ef0 Mon Sep 17 00:00:00 2001 From: TheGroundZero <2406013+TheGroundZero@users.noreply.github.com> Date: Fri, 30 Jun 2023 09:52:35 +0000 Subject: [PATCH 2/4] Fix update --- server/update | 1 + 1 file changed, 1 insertion(+) diff --git a/server/update b/server/update index 56807df..588c898 100755 --- a/server/update +++ b/server/update @@ -27,6 +27,7 @@ cd ~timezoned/zoneinfo if [ -e "posixinfo" ]; then rm posixinfo touch posixinfo +fi for i in `find *|grep /` do From 5d2d1d5765e6e82e40ecc17fd4157e0520644976 Mon Sep 17 00:00:00 2001 From: TheGroundZero <2406013+TheGroundZero@users.noreply.github.com> Date: Fri, 30 Jun 2023 12:37:22 +0200 Subject: [PATCH 3/4] get rid of another error --- server/server | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/server b/server/server index 58603f3..551693c 100755 --- a/server/server +++ b/server/server @@ -12,7 +12,7 @@ if ($file = fopen("/home/timezoned/posixinfo", "r")) { while(!feof($file)) { $line = fgets($file); preg_match("/^(.*?) (.*?)$/", $line, $matches); - if ($matches[1] != "" && $matches[2] != "") { + if (count($matches) >= 2 && $matches[1] != "" && $matches[2] != "") { array_push($tz, array("olsen" => trim($matches[1]), "posix" => trim($matches[2]))); } } @@ -164,3 +164,5 @@ while(1) } socket_close($sock); + +?> \ No newline at end of file From ab757769c8b27811d78b18228ae759040c8556ee Mon Sep 17 00:00:00 2001 From: TheGroundZero <2406013+TheGroundZero@users.noreply.github.com> Date: Fri, 30 Jun 2023 11:45:44 +0000 Subject: [PATCH 4/4] version is unused --- server/server | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/server b/server/server index 551693c..bb05761 100755 --- a/server/server +++ b/server/server @@ -93,7 +93,7 @@ while(1) $parts = explode("#", $packet, 2); $query = $parts[0]; - $version = $parts[1]; + // $version = $parts[1]; $process = strtoupper(str_replace(" ", "_", $query)); $logstart = date("D, d M Y H:i:s") . "Z -- $remote_ip:$remote_port --"; @@ -165,4 +165,4 @@ while(1) socket_close($sock); -?> \ No newline at end of file +?>