]> git.pld-linux.org Git - packages/tzdata.git/commitdiff
- more verbose and accurate messages
authorTomasz Pala <gotar@pld-linux.org>
Fri, 29 Oct 2010 00:26:45 +0000 (00:26 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    timezone.init -> 1.17

timezone.init

index a5ad643b1f0eee9f8a411ad16d1c6433ad920c81..c78eec577d5295b4dc5f8322912935714772d21b 100644 (file)
@@ -26,6 +26,7 @@ ZONE_FILE="$ZONE_FILE/$TIMEZONE"
 
 start() {
        if [ -f /var/lock/subsys/timezone ]; then
+               msg_already_running timezone
                return
        fi
 
@@ -34,9 +35,12 @@ start() {
 
                MESSAGE=$(nls 'Setting time zone information (%s)' "$TIMEZONE")
 
-               run_cmd "$MESSAGE" cp -af $ZONE_FILE /etc/localtime
+               run_cmd "$MESSAGE" cp -af "$ZONE_FILE" /etc/localtime
                RETVAL=$?
                restorecon /etc/localtime >/dev/null 2>&1
+       else
+               show "Missing %s file" "$ZONE_FILE"
+               fail
        fi
 
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/timezone
@@ -57,7 +61,7 @@ case "$1" in
        start
        ;;
   stop)
-       stop
+       stop
        ;;
   restart|try-restart|reload|force-reload)
        stop
@@ -67,7 +71,12 @@ case "$1" in
        disable
        ;;
   status)
-       nls 'Time zone configured to (%s)' "$TIMEZONE"
+       if [ -x /usr/bin/diff ]; then
+               diff -q "$ZONE_FILE" /etc/localtime >/dev/null 2>&1 && \
+               nls 'Time zone is configured to %s' "$TIMEZONE" || \
+               nls 'Current time zone differs from %s!' "$TIMEZONE"
+       else    nls 'Time zone should be set to %s' "$TIMEZONE"
+       fi
        ;;
   *)
        msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|disable|status}"
This page took 0.040627 seconds and 4 git commands to generate.