15 echo -n "checking for cygwin..."
19 echo "couldn't find uname please add cygwin to your path."
23 OSversion="`uname -v | sed 's/^\(.\).*$/\1/'`"
25 shell=`type sh | sed 's/sh is //'`
26 distdir=`dirname $shell | sed 's!^//\(.\)/\(.*\)!\1:/\2!'`
28 echo "cygwin installed in $distdir"
30 echo "checking paths ..."
32 if [ ! -d "/bin" ]; then
33 echo "You don't have a /bin directory. Would you like to mount cygwin as /bin ?"
36 mount -b $distdir /bin
38 elif [ "$distdir" != "/bin" ]; then
39 echo "Warning: you have /bin but it's not the cygwin installation."
42 if [ ! -d "/tmp" ]; then
43 echo -n "You don't have /tmp - create it?"
51 if [ ! -d "/etc" ]; then
52 echo -n "You don't have /etc - create it?"
62 if [ ! -f "/etc/termcap" ]; then
63 echo -n "You don't have /etc/termcap - create it?"
65 if [ ! -f "$distdir/../etc/termcap" ]
67 distdir=`mount | grep "$distdir" | sed -e "s/ .*$//"`
68 echo "Retrieving termcap from $distdir/../etc"
70 if [ -f "$distdir/../etc/termcap" ]
72 cp "$distdir/../etc/termcap" /etc
74 echo "Error: can't find termcap file"
78 echo "you have /etc/termcap"
81 if [ ! -f "/etc/passwd" ]; then
82 echo -n "You don't have /etc/passwd - create it?"
84 if [ "$OS" = "Windows_NT" ]
86 echo -n "Running on NT, create domain or local password file [d/l] "
90 mkpasswd -d > /etc/passwd
92 mkpasswd -l > /etc/passwd
95 echo "Please enter your userid e.g. andyp"
97 echo "Please enter your user name e.g. Andy Piper"
99 echo "Administrator::500:513:::/bin/sh" > /etc/passwd
100 echo "$userid::1000:513:$username::/bin/sh" >> /etc/passwd
104 echo "you have /etc/passwd"
105 userid=`id | sed -e "s/[^(]*(\([^)]*\)).*/\1/"`
108 echo "userid is $userid"
110 if [ ! -f "/etc/group" ]; then
111 echo -n "You don't have /etc/group - create it?"
113 if [ "$OS" = "Windows_NT" ]
115 echo -n "Running on NT, create domain or local group file [d/l] "
119 mkgroup -d > /etc/group
121 mkgroup -l > /etc/group
124 echo "None::513:" > /etc/group
125 echo "Everyone::0:" >> /etc/group
129 echo "you have /etc/group"
132 if [ ! -f "/etc/hosts" ]; then
133 echo -n "You don't have /etc/hosts - create it?"
136 echo "Machine name is $mname"
137 echo -n "Please enter your ip address "
139 echo "$mname $mipaddr" > /etc/hosts
140 echo "localhost 127.0.0.1" >> /etc/hosts
143 echo "you have /etc/hosts"
146 echo "Can't create /etc files because /etc does not exist"
149 echo "checking environment ..."
151 if [ "$HOME" = "" ]; then
152 echo -n "HOME is not set, rectify?"
154 if [ "$OS" = "Windows_NT" ]
156 echo "please enter your home path [/winnt/profiles/$userid]"
158 if [ "$HOME" = "" ]; then
159 HOME="/winnt/profiles/$userid"
162 echo "please enter your home path [/]"
164 if [ "$HOME" = "" ]; then
169 echo "HOME=$HOME; export HOME" >> $HOME/.bashrc
175 if [ "$TERM" != "ansi" -a "$TERM" != "linux" ]; then
176 echo -n "TERM is not set to linux or ansi, rectify?"
178 echo "TERM=linux; export TERM" >> $HOME/.bashrc
184 if echo $CYGWIN32 | grep -w tty; then
185 echo "CYGWIN32 is $CYGWIN32"
187 echo "CYGWIN32 does not contain \"tty\" terminal may be deficient"