-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup_project.sh
62 lines (48 loc) · 1.54 KB
/
setup_project.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
58
59
60
61
62
#!/bin/bash
# Define the project path
PROJECT_PATH="/home/svc_mwc/mwc_stratum_pool"
# Create the project directory
echo "Creating project directory at $PROJECT_PATH..."
mkdir -p "$PROJECT_PATH"
# Create subdirectories for organization
echo "Creating subdirectories..."
mkdir -p "$PROJECT_PATH/config"
mkdir -p "$PROJECT_PATH/scripts"
mkdir -p "$PROJECT_PATH/logs"
mkdir -p "$PROJECT_PATH/src"
# Add placeholder files
echo "Creating placeholder files..."
# Placeholder config file
cat <<EOL > "$PROJECT_PATH/config/pool_config.toml"
# MWC Stratum Pool Configuration File
[pool]
name = "MWC Stratum Pool"
description = "A placeholder configuration for MWC Stratum Pool"
[network]
address = "127.0.0.1"
port = 3333
EOL
# Placeholder restart script
cat <<EOL > "$PROJECT_PATH/scripts/restart_script.sh"
#!/bin/bash
# Restart script for MWC Stratum Pool
echo "Stopping existing pool processes..."
pkill -f mwc_pool || echo "No existing processes found."
echo "Starting the pool..."
cd $PROJECT_PATH/src
./mwc_pool --config ../config/pool_config.toml >> ../logs/pool.log 2>&1 &
echo "MWC Stratum Pool restarted."
EOL
chmod +x "$PROJECT_PATH/scripts/restart_script.sh"
# Placeholder log file
touch "$PROJECT_PATH/logs/pool.log"
# Placeholder source code file
cat <<EOL > "$PROJECT_PATH/src/mwc_pool"
#!/bin/bash
# Placeholder for the MWC Pool executable
echo "This is a placeholder for the MWC Pool source code."
EOL
chmod +x "$PROJECT_PATH/src/mwc_pool"
# Final message
echo "Project directory structure created at $PROJECT_PATH."
echo "Modify placeholder files as needed."