]> err.no Git - sope/blob - setlocaltz.sh
0f70f1af556d9ce7c12858a4e6af7284239f8314
[sope] / setlocaltz.sh
1 #! /bin/sh
2 #
3 # setlocaltz.sh
4 #
5 # Determine local timezone, ask user for input, save timzone
6 # in GNUstep timezone file (or defaults database)
7 #
8 # Copyright (C) 1999 Free Software Foundation, Inc.
9 #
10 # Author: Scott Christley <scottc@net-community.com>
11 #
12 # Date: February 1999
13
14 # This file is part of the GNUstep Makefile Package.
15 #
16 # This library is free software; you can redistribute it and/or
17 # modify it under the terms of the GNU General Public License
18 # as published by the Free Software Foundation; either version 2
19 # of the License, or (at your option) any later version.
20
21 # You should have received a copy of the GNU General Public
22 # License along with this library; see the file COPYING.LIB.
23 # If not, write to the Free Software Foundation,
24 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25
26 echo " "
27 echo "Enter the name of your timezone file"
28 echo "press ^D on its own line when you are done"
29 TZNAME=`cat`
30 echo " "
31
32 GNUSTEP_TIMEZONE=$GNUSTEP_SYSTEM_ROOT/Library/Libraries/Resources/gnustep-base/NSTimeZones
33 if [ -f $GNUSTEP_TIMEZONE/zones/$TZNAME ]; then
34     echo Setting timezone to $TZNAME
35     defaults write NSGlobalDomain "Local Time Zone" $TZNAME
36     echo defaults database says local time zone is:
37     defaults read NSGlobalDomain "Local Time Zone"
38 else
39     echo ERROR: Cannot find timezone file: $TZNAME
40     echo in $GNUSTEP_TIMEZONE/zones
41     exit 1
42 fi