-# $Id: rc-scripts.spec.in,v 1.40 2000/03/04 13:59:16 siefca Exp $
+# $Id: rc-scripts.spec.in,v 1.41 2000/03/04 22:40:06 siefca Exp $
Summary: inittab and /etc/rc.d scripts
Summary(de): inittab und /etc/rc.d Scripts
Summary(fr): inittab et scripts /etc/rc.d
%attr(755,root,root) %{_bindir}/doexec
%attr(755,root,root) %{_bindir}/usleep
%attr(755,root,root) %{_bindir}/ipcalc
+%attr(755,root,root) %{_bindir}/resolvesymlink
%attr(755,root,root) %{_sbindir}/setsysfont
%attr(755,root,root) %{_sbindir}/initlog
# description: This script is setting time zone information for your machine.
# Author: Pawel Wilk <siefca@pld.org.pl>
#
-# $Id: timezone,v 1.2 2000/03/04 13:39:51 siefca Exp $
+# $Id: timezone,v 1.3 2000/03/04 22:40:06 siefca Exp $
# NLS
NLS_DOMAIN="rc-scripts"
. /etc/rc.d/init.d/functions
[ ! -f /etc/sysconfig/timezone ] && exit 0
-
. /etc/sysconfig/timezone
-# See how we were called.
-case "$1" in
- start)
- if [ -f /etc/localtime ]; then
- rm -f /etc/localtime
- fi
-
- ZONE_FILE="$ZONE_INFO_DIR"
+ZONE_FILE="$ZONE_INFO_DIR"
- if [[ "$ZONE_INFO_SCHEME" != "" ]]; then
- ZONE_FILE="$ZONE_FILE/$ZONE_INFO_SCHEME"
- fi
+if [[ "$ZONE_INFO_SCHEME" != "" ]]; then
+ ZONE_FILE="$ZONE_FILE/$ZONE_INFO_SCHEME"
+fi
- if [[ "$ZONE_INFO_AREA" != "" ]]; then
- ZONE_FILE="$ZONE_FILE/$ZONE_INFO_AREA"
- fi
+if [[ "$ZONE_INFO_AREA" != "" ]]; then
+ ZONE_FILE="$ZONE_FILE/$ZONE_INFO_AREA"
+fi
+
+ZONE_FILE="$ZONE_FILE/$TIME_ZONE"
- ZONE_FILE="$ZONE_FILE/$TIME_ZONE"
+[ -L /etc/localtime -a "`resolvesymlink /etc/localtime`" == "$ZONE_FILE" ] && exit 0
+# See how we were called.
+case "$1" in
+ start)
+ rm -f /etc/localtime
if [ -f "$ZONE_FILE" ]; then
if [[ "$ZONE_INFO_AREA" != "" ]]; then
run_cmd "Setting time zone information ($ZONE_INFO_AREA, $TIME_ZONE)" ln -s $ZONE_FILE /etc/localtime
--- /dev/null
+#include <sys/param.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+int main(int argc, char ** argv) {
+ char *buf = calloc (MAXPATHLEN+1, sizeof(char));
+
+ if (argc<1) return 1;
+ (void) readlink (argv[1], buf, MAXPATHLEN);
+ fprintf (stdout, "%s", buf);
+ exit (0);
+ }