changeset 222:16238e9032a9

Skip configuring a timezone when there already exists such a file /etc/localtime
author Franz Glasner <f.glasner@feldmann-mg.com>
date Wed, 31 Aug 2022 12:41:18 +0200
parents f62f8ec6a19b
children dce9ba905c32
files sbin/fjail
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/sbin/fjail	Mon Aug 29 16:12:24 2022 +0200
+++ b/sbin/fjail	Wed Aug 31 12:41:18 2022 +0200
@@ -353,7 +353,12 @@
     sysrc -R "${_mp}" bsdstats_enable=NO       # no automatic BSD stats when booting
 
     # Timezone to CET
-    ln -s ../usr/share/zoneinfo/Europe/Berlin "${_mp}/etc/localtime"
+    if [ ! -f "${_mp}/etc/localtime" ]; then
+        echo "Setting timezone to Europe/Berlin"
+        ln -s ../usr/share/zoneinfo/Europe/Berlin "${_mp}/etc/localtime"
+    else
+        echo "WARNING: \"${_mp}/etc/localtime\" exists already -- not changed"
+    fi
 
     # XXX FIXME What about hostid in vnet jails (see /etc/rc.d/hostid and /etc/rc.d/hostid_save)
 }