-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·54 lines (41 loc) · 1.13 KB
/
setup.sh
File metadata and controls
executable file
·54 lines (41 loc) · 1.13 KB
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
#!/bin/bash
# -*- coding: utf-8 -*-
# setup.sh
# SDNetwork
#
# Created by admin on 2019-11-20.
# Copyright © 2019 Maxim Puchkov. All rights reserved.
# This script is run remotely to finish installation on the VM
# Relative to setup.sh directory
#REL="$(dirname $0)"
# Copy bundle with TestNet to VM
BUNDLE_NAME="${1:-SDNetwork}"
NET_LIB="TestNet"
# ./installnet.sh <VM IP address>
# Default IP: 192.168.56.3
VM_BUNDLE_DIR=~/${BUNDLE_NAME}
# Names of executables scripts
SETUP="setup.py"
RUN="run.py"
# Install Python TestNet package in
# /usr/local/lib/python2.7/dist-packages/
install_packages() {
VM_LIBRARY="${VM_BUNDLE_DIR}/SDNetwork/Library"
TMP=~/${NET_LIB}
mv "${VM_LIBRARY}/${NET_LIB}" "${TMP}"
sudo python "${TMP}/${SETUP}" 'install'
mv "${TMP}" "${VM_LIBRARY}/${NET_LIB}"
}
# Move the 'dist' folder from ~ to ~/$(PRODUCT_NAME)/var
cleanup() {
DIR="dist"
EXT="egg-info"
NET_BUILD="${NET_LIB}.${EXT}"
sudo mv "${NET_BUILD}" "${DIR}/${NET_BUILD}"
VAR="${VM_BUNDLE_DIR}/var"
mkdir "${VAR}"
sudo mv "${DIR}" "${VAR}/${DIR}"
sudo rm -r "build"
}
install_packages
#cleanup