📄 uninst
字号:
#!/bin/sh
#
# Copyright 1984-1996 Wind River Systems, Inc.
#
# modification history
# --------------------
# 01g,13jun97,pdn started using standard TCL/TK shell, cleanup.
# 01f,24feb96,pdn fixed the broken pipe problem on hpux machine.
# 01e,18dec96,pdn change location of "TCL" to "RESOURCE/TCL" on CD
# 01d,05nov96,pdn added support for AIX host.
# 01c,25oct96,pdn exec a temporary script so all files can be removed.
# 01b,18oct96,pdn allowed relative path to be used.
# 01a,16oct96,pdn Written.
#
##############################################################################
# Initialize
#
WIND_BASE=$1
UI=TK
usage="Usage: $0 <Installed Directory>"
##############################################################################
# checks for valid WIND_BASE
#
if [ "$WIND_BASE" = "" -o ! -d "$WIND_BASE" ]; then
echo "$usage"
exit 0
else
ROOT=`pwd`
cd $WIND_BASE
WIND_BASE=`pwd`
cd $ROOT
UNINST_HOME=$WIND_BASE/.wind/uninst
fi
##############################################################################
# obtains the host type
#
case `/bin/uname -srvm` in
SunOS\ 5.*\ sun4*)
WIND_HOST_TYPE=sun4-solaris2
;;
SunOS\ 4.*\ sun4*)
WIND_HOST_TYPE=sun4-sunos4
;;
HP-UX\ ?.09.*\ 9000/*)
WIND_HOST_TYPE=parisc-hpux9
;;
HP-UX\ ?.10.*\ 9000/*)
WIND_HOST_TYPE=parisc-hpux10
;;
AIX\ ?\ 4\ *)
WIND_HOST_TYPE=rs6000-aix4
;;
*)
echo 1>&2 "### You are logging in to a platform whose type"
echo 1>&2 "### is not supported by the Tornado product."
echo 1>&2 "### Aborting uninstall."
exit 0
;;
esac
##############################################################################
# checks the DISPLAY environment variable.
#
if [ "$DISPLAY" = "" ]; then
echo ""
echo "Warning: The DISPLAY environment variable is not set."
echo " Please set it, and re-run $0."
echo ""
exit
else
BIN_DIR=$WIND_BASE/host/$WIND_HOST_TYPE/bin
fi
##############################################################################
# Create temporary directory
#
if [ "$TMPDIR" != "" ]; then
TMP=$TMPDIR/UnInst$$
elif [ "$TMP" != "" ]; then
TMP=$TMP/UnInst$$
else
TMP=/tmp/UnInst$$
fi
mkdir -p $TMP || mkdir $TMP || exit 0
##############################################################################
# copy the uninstall binaries to the temporary dir
#
TRY1=$BIN_DIR/INSTTK2
TRY2=$BIN_DIR/wtxwish
if [ -f "$TRY1" ]; then
cp $TRY1 $TMP
PROGRAM=$TMP/INSTTK2
elif [ -f "$TRY2" ]; then
cp $TRY2 $TMP
PROGRAM=$TMP/wtxwish
else
echo "${TRY1}: not found"
echo "${TRY2}: not found"
exit 1
fi
cp $BIN_DIR/setuptcl.* $TMP
##############################################################################
# untar the tcl/tk libraries
#
(cd $TMP; tar xf $UNINST_HOME/TKLIB.TAR)
##############################################################################
# Create another script in TMP dir. We will launch this script
# to do actual uninstall.
#
cat > $TMP/UNINST << EOF
TCL_LIBRARY=$TMP/lib/tcl
TK_LIBRARY=$TMP/lib/tk
WIND_HOST_TYPE=$WIND_HOST_TYPE
UI=$UI
TMP=$TMP
export TCL_LIBRARY
export TK_LIBRARY
export WIND_HOST_TYPE
export UI
export TMP
$PROGRAM $UNINST_HOME/UNINST.TCL $WIND_BASE
sleep 5
rm -rf $TMP
EOF
chmod 744 $TMP/UNINST
##############################################################################
# starts the uninstall program in the background.
#
exec $TMP/UNINST &
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -