-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy_python2.exp
More file actions
executable file
·34 lines (26 loc) · 885 Bytes
/
Copy pathdeploy_python2.exp
File metadata and controls
executable file
·34 lines (26 loc) · 885 Bytes
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
#!/usr/bin/expect -f
set timeout 600
set server "182.92.127.90"
set user "root"
set password "TANGlidong24ban!"
spawn ssh -o StrictHostKeyChecking=no $user@$server
expect "password:"
send "$password\r"
expect "# "
# Check if Python 3.12 was partially installed
send "python3.12 --version 2>/dev/null && echo 'Python 3.12 OK' || echo 'Need to install'\r"
expect "# "
# If not installed, try alternative: install from source with minimal options
send "cd /tmp && ls -la Python-3.12* 2>/dev/null || echo 'No Python source'\r"
expect "# "
# Try to compile if source exists
send "cd /tmp/Python-3.12.4 2>/dev/null && ./configure --prefix=/usr/local 2>&1 | tail -3\r"
expect -timeout 120 "# "
send "make -j2 2>&1 | tail -3\r"
expect -timeout 300 "# "
send "make altinstall 2>&1 | tail -3\r"
expect -timeout 300 "# "
send "python3.12 --version\r"
expect "# "
send "exit\r"
expect eof