File: sys_config.sh

package info (click to toggle)
pdksh 5.2.14-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 1,832 kB
  • ctags: 2,272
  • sloc: ansic: 23,599; perl: 945; makefile: 595; sh: 280; sed: 40
file content (64 lines) | stat: -rwxr-xr-x 1,519 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
:
# NAME:
#	sys_config.sh - set system specific variables
#
# SYNOPSIS:
#	. /etc/sys_config.sh
#
# DESCRIPTION:
#	Source this script into shell scripts that want to handle
#	various system types.
#	You may well want to edit this on a particular system replacing 
#	`uname -s` etc with the result.  So that the facility will work 
#	even when in single user mode and uname et al are not available.
#
# SEE ALSO:
#	/etc/profile

# RCSid:
#	$Id: sys_config.sh,v 1.5 93/09/29 08:59:36 sjg Exp $
#
#	@(#)Copyright (c) 1991 Simon J. Gerraty
#
#	This file is provided in the hope that it will
#	be of use.  There is absolutely NO WARRANTY.
#	Permission to copy, redistribute or otherwise
#	use this file is hereby granted provided that 
#	the above copyright notice and this notice are
#	left intact. 
#

# determin machine type
if [ -f /386bsd ]; then		# doesn't have uname or arch
	ARCH=i386
	OS=386bsd
	HOSTNAME=`hostname`
elif [ -f /usr/bin/arch ]; then
	ARCH=`arch`
elif [ -f /usr/bin/uname -o -f /bin/uname ]; then
	ARCH=`uname -m`
fi
#
case "$ARCH" in
sun386)	uname=/usr/5bin/uname
	OS=SunOS
	;;
*)	uname=uname;;
esac

# set the operating system type
# you can't use `uname -s` with SCO UNIX
# it returns the same string as `uname -n`
# so set it manually
# OS=SCO-UNIX
# The eval below is a workaround for a bug in the PD ksh.
OS=${OS:-`eval $uname -s`}
HOSTNAME=${HOSTNAME:-`eval $uname -n`}

case `echo -n ""` in
-n*)	_C_=""; _N_="-n";;
*)	_C_="\c"; _N_="";;
esac
N="${_N_}"
C="${_C_}"
export OS ARCH HOSTNAME uname