]> git.pld-linux.org Git - packages/tzdata.git/blame - timezone.sh
up to 2015f
[packages/tzdata.git] / timezone.sh
CommitLineData
95a3c0b6
JR
1#!/bin/sh
2
717b5309 3if [ -x /usr/bin/timedatectl ] && \
96607aa2
ER
4 [ -z "$ZONE_INFO_DIR" -o "$ZONE_INFO_DIR" = "/usr/share/zoneinfo" ] && \
5 [ -z "$ZONE_INFO_SCHEME" -o "$ZONE_INFO_SCHEME" = "posix" ] ; then
717b5309
JK
6 exec /usr/bin/timedatectl set-timezone "$TIMEZONE"
7fi
8
95a3c0b6
JR
9ZONE_FILE="$ZONE_INFO_DIR"
10
11if [ -n "$ZONE_INFO_SCHEME" -a "$ZONE_INFO_SCHEME" != "posix" ]; then
12 ZONE_FILE="$ZONE_FILE/$ZONE_INFO_SCHEME"
13fi
14
15ZONE_FILE="$ZONE_FILE/$TIMEZONE"
16
17[ -L /etc/localtime ] && [ "$(resolvesymlink /etc/localtime)" = "$ZONE_FILE" ] && exit 0
18[ -f "$ZONE_FILE" ] || exit 2
19
20rm -f /etc/localtime
21
22cp -af "$ZONE_FILE" /etc/localtime
23RETVAL=$?
24restorecon /etc/localtime >/dev/null 2>&1
25exit $RETVAL
This page took 0.086913 seconds and 4 git commands to generate.