summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--00-base/functions.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/00-base/functions.sh b/00-base/functions.sh
index 8523da7..ea910f3 100644
--- a/00-base/functions.sh
+++ b/00-base/functions.sh
@@ -22,6 +22,27 @@ function check_vars() {
return ${retval}
}
+function configure_timezone() {
+ if [ -f "/usr/share/zoneinfo/$1" ]; then
+ timezone=$1
+ else
+ echo "WARNING: Invalid timezone $1, using UTC"
+ timezone="UTC"
+ fi
+
+ ln -vf \
+ /usr/share/zoneinfo/${timezone} \
+ /etc/localtime
+
+ if [ -f "/etc/php.ini" ]; then
+ sed -i -r \
+ -e '/^date.timezone/d' \
+ -e '/^;date.timezone/d' \
+ -e "s|\[Date\]|[Date]\ndate.timezone = ${timezone}|g" \
+ /etc/php.ini
+ fi
+}
+
function domain_to_root_dn() {
echo "dc=$(echo $1 | sed -e 's/\./,dc=/g')"
}