-
Notifications
You must be signed in to change notification settings - Fork 3
/
Reinstall-App.sh
executable file
·75 lines (75 loc) · 1.59 KB
/
Reinstall-App.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
set -e
IP=$1
cd support_files/4.3/File_System
echo "Sending runasroot "
/usr/bin/expect <(cat << EOF
set timeout -1
spawn scp -P 22 -o StrictHostKeyChecking=no runasroot root@$IP:/usr/bin
expect "root@$IP's password:"
send "alpine\r"
expect eof
)
echo "Sending Boot..."
/usr/bin/expect <(cat << EOF
set timeout -1
spawn scp -P 22 -o StrictHostKeyChecking=no boot.sh root@$IP:/
expect "root@$IP's password:"
send "alpine\r"
expect eof
)
cd ../App
echo "Sending App..."
/usr/bin/expect <(cat << EOF
set timeout -1
spawn scp -P 22 -o StrictHostKeyChecking=no -r 4tify.app root@$IP:/Applications
expect "root@$IP's password:"
send "alpine\r"
expect eof
)
echo "Moving Everything Into Place..."
sleep 2
/usr/bin/expect <(cat << EOF
set timeout -1
spawn ssh -o StrictHostKeyChecking=no -p 22 root@$IP
expect "root@$IP's password:"
send "alpine\r"
expect "#"
send "chmod 6755 /Applications/4tify.app/4tify\r"
expect "#"
send "chmod 4755 /usr/bin/runasroot\r"
expect "#"
send "chown root:wheel /usr/bin/runasroot\r"
expect "#"
send "chmod 6755 /usr/bin/runasroot\r"
expect "#"
send "chmod 6755 /boot.sh\r"
expect "#"
send "exit\r"
expect eof
)
sleep 2
/usr/bin/expect <(cat << EOF
set timeout -1
spawn ssh -o StrictHostKeyChecking=no -p 22 mobile@$IP
expect "mobile@$IP's password:"
send "alpine\r"
expect "mobile"
send "uicache\r"
expect "mobile"
send "exit\r"
expect eof
)
sleep 2
/usr/bin/expect <(cat << EOF
set timeout -1
spawn ssh -o StrictHostKeyChecking=no -p 22 root@$IP
expect "root@$IP's password:"
send "alpine\r"
expect "#"
send "killall -9 SpringBoard\r"
expect "#"
send "exit\r"
expect eof
)
echo "Done!"