I am having some odd
problems with the %pre part of my script and started to debug it by wrapping
things in "sh -xv" so I could see more of what was running and put in a few
statements to help me determine the environment. The problem seems to be that
typing pwd reports "no such directory", as does cd /, yet writing to /tmp
works fine.......huh? I'm not quite sure what is going on here. It all works
fine in vt 2 where redhat has the shell prompt. Is this environment different
somehow?
Any input would be
appreciated.
Thanks,
Sean
--------------------------------------------------------------------
%pre
#First statement!!!
/bin/sh -xv <<EOF
cd /
/usr/bin/whoami >> /tmp/whoami
/usr/bin/df -h >> /tmp/df
/usr/bin/chvt 3
#First statement!!!
/bin/sh -xv <<EOF
cd /
/usr/bin/whoami >> /tmp/whoami
/usr/bin/df -h >> /tmp/df
/usr/bin/chvt 3
#SET VARIABLES
/usr/bin/pwd > /tmp/pwd
export > /tmp/export
export CLIENT="BOB"
/usr/bin/pwd > /tmp/pwd
export > /tmp/export
export CLIENT="BOB"
/sbin/insmod
/mnt/source/installer/modules/dpt_i2o.o
EOF
EOF
#Set MOTD
/usr/bin/cat <<EOF >/etc/motd
***************************************************************************
NOTICE TO USERS
/usr/bin/cat <<EOF >/etc/motd
***************************************************************************
NOTICE TO USERS
This is a private computer system and is the property of $CLIENT.
It is for authorized use only. Users (authorized or unauthorized)
have no explicit or implicit expectation of privacy.
Any or all uses of this system and all files on this system may be
intercepted, monitored, recorded, copied, audited, inspected, and disclosed
to law enforcement personnel, as well as authorized officials of other
agencies, both domestic and foreign. By using this system, the user consents
to such interception, monitoring, recording, copying, auditing, inspection,
and disclosure at the discretion of authorized site personnel.
intercepted, monitored, recorded, copied, audited, inspected, and disclosed
to law enforcement personnel, as well as authorized officials of other
agencies, both domestic and foreign. By using this system, the user consents
to such interception, monitoring, recording, copying, auditing, inspection,
and disclosure at the discretion of authorized site personnel.
Unauthorized or improper use of this system may result in administrative
disciplinary action and civil and criminal penalties. By continuing to use
this system you indicate your awareness of and consent to these terms and
conditions of use. LOG OFF IMMEDIATELY if you do not agree to the conditions
stated in this warning.
disciplinary action and civil and criminal penalties. By continuing to use
this system you indicate your awareness of and consent to these terms and
conditions of use. LOG OFF IMMEDIATELY if you do not agree to the conditions
stated in this warning.
*****************************************************************************
EOF
#Set ISSUE
/usr/bin/cat <<EOF >/etc/issue
***************************************************************************
NOTICE TO USERS
/usr/bin/cat <<EOF >/etc/issue
***************************************************************************
NOTICE TO USERS
This is a private computer system and is the property of $CLIENT.
It is for authorized use only. Users (authorized or unauthorized)
have no explicit or implicit expectation of privacy.
Any or all uses of this system and all files on this system may be
intercepted, monitored, recorded, copied, audited, inspected, and disclosed
to law enforcement personnel, as well as authorized officials of other
agencies, both domestic and foreign. By using this system, the user consents
to such interception, monitoring, recording, copying, auditing, inspection,
and disclosure at the discretion of authorized site personnel.
intercepted, monitored, recorded, copied, audited, inspected, and disclosed
to law enforcement personnel, as well as authorized officials of other
agencies, both domestic and foreign. By using this system, the user consents
to such interception, monitoring, recording, copying, auditing, inspection,
and disclosure at the discretion of authorized site personnel.
Unauthorized or improper use of this system may result in administrative
disciplinary action and civil and criminal penalties. By continuing to use
this system you indicate your awareness of and consent to these terms and
conditions of use. LOG OFF IMMEDIATELY if you do not agree to the conditions
stated in this warning.
disciplinary action and civil and criminal penalties. By continuing to use
this system you indicate your awareness of and consent to these terms and
conditions of use. LOG OFF IMMEDIATELY if you do not agree to the conditions
stated in this warning.
*****************************************************************************
EOF
#Last statement!!!
/usr/bin/chvt 7
/usr/bin/chvt 7