File: setup

package info (click to toggle)
ngetty 1.1-13
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 448 kB
  • sloc: ansic: 1,585; makefile: 201; sh: 193; asm: 100
file content (31 lines) | stat: -rwxr-xr-x 520 bytes parent folder | download | duplicates (7)
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