-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstaller.sh
57 lines (42 loc) · 1.36 KB
/
installer.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
#!/bin/bash
echo " ___ __ __ _ ____ __ ____ "
echo " / __)/ \ ( ( \( __)( )(__ )"
echo "( (__( O )/ / ) _) )( / _/ "
echo " \___)\__/ \_)__)(____)(__)(____)"
echo " CZLINK CLIENT INSTALLER "
# Update package list and install npm and git
echo "Updating package list..."
sudo apt update
echo "Installing npm and git..."
sudo apt install npm git -y
# Install nvm
echo "Installing NVM..."
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
source ~/.bashrc
# Install Node.js
echo "Fetching available Node.js versions..."
nvm list-remote
echo "Installing Node.js version 21.7.3..."
nvm install v21.7.3
# Clone the repository
echo "Cloning the repository..."
git clone https://github.com/coneiz/czlink-client.git
# Change to the repository directory
cd czlink-client || { echo "Failed to enter directory"; exit 1; }
# Create .env file
echo "Creating .env file..."
read -p "Enter the port (default 8742): " port
read -p "Enter the folder path (default ./): " folderPath
# Use default values if empty
port=${port:-8742}
folderPath=${folderPath:-./}
cat <<EOL > .env
PORT=$port
FOLDER_PATH=$folderPath
EOL
echo ".env file created with the following content:"
cat .env
# Run npm install
echo "Running npm install..."
npm install
echo "Installation completed successfully!"