NetBSD/share/sushi/system/localtime/script1
garbled 337e8af6f6 Add a new sushi menu, system/localtime. This menu will allow the user to
set his /etc/localtime file.  It's functionally similar to the option in
sysinst.
2001-04-29 04:53:05 +00:00

17 lines
569 B
Bash
Executable File

#!/bin/sh
# $NetBSD: script1,v 1.1 2001/04/29 04:53:07 garbled Exp $
ls -l /etc/localtime | grep -- '->' >/dev/null 2>&1
if [ "$?" = "0" ]; then
NAME=`ls -l /etc/localtime | sed -e 's/.*-> \(.*\)/\1/' | \
sed -e 's@/usr/share/zoneinfo/@@'`
else
# else we gotta do it the hard way
MD5=`md5 /etc/localtime | awk '{print $4}'`
NAME=`find /usr/share/zoneinfo | xargs md5 | grep $MD5 | head -1 | \
sed -e 's/.*(\(.*\)).*/\1/' | sed -e 's@/usr/share/zoneinfo/@@'`
fi
echo $NAME
find /usr/share/zoneinfo -type f | sed -e 's@/usr/share/zoneinfo/@@' \
| grep -v $NAME