shithub: riscv

ref: 6c7d0aeb7d937a3dcf924f1ef2952ee6c7aa9eb3
dir: /rc/bin/inst/tzsetup/

View raw version
#!/bin/rc

# desc: choose time zone

switch($1){
case checkdone
	if(~ $#tzd 1 && ~ $tzd done)
		tzsetup=done
	if not
		tzsetup=ready
	export tzsetup
case go
	echo
	echo 'Setup Time Zone'
	echo

	options=`{ls -p /n/newfs/adm/timezone | grep -v -e '(README|local)'}
	prompt -d US_Eastern 'Time Zone' $options
	
	if(test -f /n/newfs/adm/timezone/$rd){
		cp /n/newfs/adm/timezone/$rd /n/newfs/adm/timezone/local
		tzd=done
	}
	if not
		tzd=failed
	export tzd
}