-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.sh
executable file
·42 lines (33 loc) · 1 KB
/
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
#!/bin/bash
# Lol. Micro instance on gcp so check if service is running and stop it
if systemctl --user is-active --quiet mercer-bluesky; then
echo "Stopping existing service..."
systemctl --user stop mercer-bluesky
sleep 1 # Give it time to fully stop
fi
# Check available memory
FREE_MEM=$(free -m | awk '/^Mem:/{print $4}')
if [ $FREE_MEM -lt 200 ]; then
echo "Warning: Low memory ($FREE_MEM MB). Waiting additional time..."
sleep 5
fi
# Install dependencies and build client
cd client
npm install
npm run build
cd ..
# Install server dependencies
cd server
npm install
cd ..
# Ensure systemd user directory exists
mkdir -p ~/.config/systemd/user/
# Copy service file
cp ./systemd/mercer-bluesky.service ~/.config/systemd/user/
# Reload systemd user daemon
systemctl --user daemon-reload
# Enable and start service
systemctl --user enable mercer-bluesky
systemctl --user start mercer-bluesky
echo "Service installed and started. Check status with:"
echo "systemctl --user status mercer-bluesky"