aboutsummaryrefslogtreecommitdiff
path: root/riemann.fmi.uni-sofia.bg/ngetty/ngetty-1.1/contrib/setup
blob: 15d15db0a847c1e057874ba411527286385f2160 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh
export PATH=/bin:/usr/bin

test -f Conf.sed || exit 111
umask 077

z=`date '+%z %Z'`

tz=`echo "$z" | awk '{
  hour = substr($1, 1, 3);
  min  = substr($1, 4, 2);
  if (hour < 0) min = -min;
  print (hour *60 +min) *60;
}'`

echo 'AUTO time zone:  '$z'  ->  '$tz

# merges lines ending with slash (/) like bash

sed -e '1i#	Auto-generated file. Do not edit!
:a
/[^\\]\\$/{
N
s/\\\n//
ta
}
s/^\([a-z0-9/]*=tz=\)AUTO$/\1'$tz'/
/^$/d
/^[ #	]/d
s/\\\\$/\\/
' Conf.sed > 'Conf.__#*tmp*#' && mv 'Conf.__#*tmp*#' Conf