-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.sh
46 lines (30 loc) · 881 Bytes
/
install.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
#!/bin/bash
# Extract version from package.json using jq
VERSION=$(jq -r '.version' ./package.json)
# Echo installation message
echo ""
echo "Installing s3b-server..."
echo "Version: $VERSION"
echo "----------------------------------"
echo ""
echo "> Installing dependencies..."
# Install npm packages globally and locally
npm install
sudo npm install -g pm2
# Create /volume directory and set permissions
VOLUME_DIR="/volume"
echo ""
echo "> Creating cloud directory $VOLUME_DIR..."
# Check if directory doesn't exist
if [ ! -d "$VOLUME_DIR" ]; then
# Create the directory and set permissions
sudo mkdir -p "$VOLUME_DIR"
fi
echo "> Changing owner of $VOLUME_DIR $(whoami):$(whoami)"
sudo chown -R $(whoami):$(whoami) "$VOLUME_DIR"
# Clean up install.sh if no longer needed
echo ""
echo "> Cleaning up project..."
rm install.sh
rm install.bat
echo "> Done."