-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathlamda_setup.sh
More file actions
44 lines (37 loc) · 1000 Bytes
/
lamda_setup.sh
File metadata and controls
44 lines (37 loc) · 1000 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
35
36
37
38
39
40
41
42
43
#!/bin/bash
function lamda_server_start() {
echo Lamda starting
# adb shell "nohup 2>&1 1&>/dev/null sh /data/local/tmp/arm64-v8a/bin/launch.sh" &
adb shell << EOF
sh /data/local/tmp/arm64-v8a/bin/launch.sh
exit
EOF
}
function lamda_server_setup_then_start() {
echo Lamda setup
adb push $HOME/$FILENAME_LAMDA /data/local/tmp
# adb shell "nohup 2>&1 1&>/dev/null sh /data/local/tmp/$FILENAME_LAMDA" &
adb shell << EOF
sh /data/local/tmp/$FILENAME_LAMDA
exit
EOF
}
function lamda_server_setup() {
local exists=`adb shell "[ -f /data/local/tmp/arm64-v8a/bin/launch.sh ] || echo 1"`
if [ -z "$exists" ]; then
echo "Lamda exists";
lamda_server_start
else
echo "Lamda doesn't exist";
lamda_server_setup_then_start
fi
}
function lamda_server_clean() {
rm -rf /data/local/tmp/arm64-v8a
rm -rf /data/usr
}
adb root
lamda_server_setup &
pip3 install -U lamda -q 1>/dev/null
echo Waiting lamda server up...
wait