-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0_osenv.sh
executable file
·49 lines (42 loc) · 1.12 KB
/
0_osenv.sh
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
#!/bin/bash
#source `pwd`/conf ## for /bin/ksh
source config.ini # use /bin/bash for reading from the current directory
source jscommon.sh
# For all hosts, check if the command exist. If not. install.
swCmdChkAllHost(){
for SWNAME in "$@"
do
for HOST in $ALLHOST
do
disp_msglvl2 "Installing $SWNAME on $HOST..."
ssh $SSH_NO_BANNER root@$HOST which $SWNAME > /dev/null
if [ $? -ne 0 ]; then
ssh $SSH_NO_BANNER $HOST yum -y install $SWNAME
else
echo "$SWNAME is already installed on $HOST"
fi
done
done
}
setProfile(){
disp_msglvl2 "setting set -o vi"
echo "set -o vi" >> /etc/bashrc
for HOST in $ALLHOST
do
echo "copying to $HOST"
scp /etc/bashrc root@$HOST:/etc
done
}
#installXterm
swCmdChkAllHost "xterm"
setProfile
pyChk ## install python on the 1st host only. To run setup script, python is needed.
goChk
disp_msglvl1 "Copying frequently used commands to /usr/local/bin"
for f in menu.py
do
rm -f /usr/local/bin/$f
disp_msglvl2 "Copying `pwd`/$f"
cp `pwd`/$f /usr/local/bin
which $f
done