2011-04-27 19:57:03 +02:00
|
|
|
#!/bin/bash
|
|
|
|
# localtime - localtime plugin for postplug
|
2013-04-05 14:23:43 +02:00
|
|
|
# Copyright (c) 2004-2013 by Silvan Calarco <silvan.calarco@qilinux.it>
|
2011-04-27 19:57:03 +02:00
|
|
|
# Copyright (c) 2004-2007 by Davide Madrisan <davide.madrisan@qilinux.it>
|
|
|
|
|
|
|
|
if [ $UID != 0 ]; then
|
|
|
|
echo "$0: must be superuser." >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2013-04-05 14:23:43 +02:00
|
|
|
[ -e /etc/localtime ] && exit 0
|
2011-04-27 19:57:03 +02:00
|
|
|
|
|
|
|
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
|
2013-04-05 14:23:43 +02:00
|
|
|
es_*)
|
|
|
|
echo "Europe/Madrid" > /etc/timezone
|
|
|
|
ln -sf $ZONEINFODIR/Europe/Madrid /etc/localtime
|
|
|
|
;;
|
2011-04-27 19:57:03 +02:00
|
|
|
it_*)
|
|
|
|
echo "Europe/Rome" > /etc/timezone
|
2013-04-05 14:23:43 +02:00
|
|
|
ln -sf $ZONEINFODIR/Europe/Rome /etc/localtime
|
2011-04-27 19:57:03 +02:00
|
|
|
;;
|
|
|
|
*) echo "GMT" > /etc/timezone
|
2013-04-05 14:23:43 +02:00
|
|
|
ln -sf $ZONEINFODIR/GMT /etc/localtime
|
2011-04-27 19:57:03 +02:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
[ -x /etc/init.d/setclock ] && service setclock start &>/dev/null
|
|
|
|
|
|
|
|
exit 0
|