-
Notifications
You must be signed in to change notification settings - Fork 0
/
basic.sh
executable file
·57 lines (47 loc) · 1.06 KB
/
basic.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
50
51
52
53
54
55
56
57
#!/bin/bash
# 'what do you want?'
#echo $HOME --- home path
#pwd -- current working dir
#echo "value of pwd is $(pwd)"
#output=$(pwd)
#echo "${output}"
#echo "I saw $@ on comand line " #-- option for entering string
#echo "enter something : "
#read userInput #---user input
#echo "you have entered ${userInput}"
#if [ -d /var/www/whitecompany ]; then
# echo "file is there"
#else
# echo "not there"
#fi
#echo "Do you love your boyfriend : "
#read userInput #---user input
#if [ $userInput == "yes" ]; then
# echo "are you sure?"
#else
# echo "stop being difficult"
#fi
#for i in $(ls -1)
#do
# echo "is $i"
#done
echo -n Enter User Id:
read userid
echo -n "Enter Password for remote user:"
read -s password
hostname=`hostname`
expect -c '
enter code here
spawn ssh ${userid}@'"$hostname"'
expect "Password: "
send '99999'
expect "$ "
send "pbrun su - tibco\r"
expect "$ "
send "exit\r"
expect "$ "
send "pbrun bash\r"
expect "$ "
send "ps -ef |grep apache\r"
expect "$ "
send "exit\r"