-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup_node.sh
56 lines (42 loc) · 1.01 KB
/
setup_node.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
#!/bin/bash
# Remove OLD Server if available
if [[ -d "node_server" ]]; then
rm -rf node_server
fi;
# Getting server from github
git clone https://github.com/project-ncloud/node_server.git
# Goto the work dir
cd node_server
# Getting samba package from github
git clone https://github.com/project-ncloud/samba.git
# Installing Dependencies
sudo pip3 install -r requirements.txt
# Genarating KEY For master
echo "Enter Master KEY: "
read KEY
echo "Enter Admin KEY: "
read ADMIN_KEY
if [[ "$OSTYPE" == "msys" ]]; then
HOSTNAME="127.0.0.1"
CONFIG_FILE="etc/samba/smb.conf"
# Creating Fake smb.conf for windows
mkdir -p etc/samba/
touch etc/samba/smb.conf
else
HOSTNAME=$(hostname -I | cut -d' ' -f1)
CONFIG_FILE="/etc/samba/smb.conf"
fi;
# Genarating environment file for node
cat > .env <<EOF
CONFIG_FILE=$CONFIG_FILE
SECRET_KEY=$KEY
OWN_URL=${HOSTNAME}:7000
PORT=7000
TYPE=dev
ADMIN_USER=admin
ADMIN_KEY=$ADMIN_KEY
RESTRICT_KEYWORD=raspberry_pi_admin
EOF
echo ""
echo "DONE..."
echo ""