36 lines
761 B
Bash
36 lines
761 B
Bash
#!/bin/bash
|
|
# localtime - localtime plugin for postplug
|
|
# Copyright (c) 2004-2005 by Silvan Calarco <silvan.calarco@qilinux.it>
|
|
# Copyright (c) 2004-2007 by Davide Madrisan <davide.madrisan@qilinux.it>
|
|
|
|
if [ $UID != 0 ]; then
|
|
echo "$0: must be superuser." >&2
|
|
exit 1
|
|
fi
|
|
|
|
[ -f /etc/localtime ] && exit 0
|
|
|
|
me="localtime"
|
|
|
|
. /etc/postplug/postplug.defs
|
|
|
|
LOCALTIMEFILE=/etc/localtime
|
|
ZONEINFODIR=/usr/share/zoneinfo
|
|
|
|
logmsg "$me" $"creating /etc/timezone and /etc/localtime files..."
|
|
|
|
# FIXME
|
|
case "$LANG" in
|
|
it_*)
|
|
echo "Europe/Rome" > /etc/timezone
|
|
cp -f $ZONEINFODIR/Europe/Rome /etc/localtime
|
|
;;
|
|
*) echo "GMT" > /etc/timezone
|
|
cp -f $ZONEINFODIR/GMT /etc/localtime
|
|
;;
|
|
esac
|
|
|
|
[ -x /etc/init.d/setclock ] && service setclock start &>/dev/null
|
|
|
|
exit 0
|