28
28
exit 1
29
29
fi
30
30
31
- NODE_VERSION=" 20" setup_nodejs
31
+ # Get latest release info
32
+ msg_info " Checking for latest Pulse release"
33
+ RELEASE_INFO=$( curl -s https://api.github.com/repos/rcourtman/Pulse/releases/latest)
34
+ LATEST_VERSION=$( echo " $RELEASE_INFO " | grep ' "tag_name":' | sed -E ' s/.*"([^"]+)".*/\1/' )
32
35
33
- msg_info " Setup Pulse"
34
- RELEASE=$( curl -fsSL https://api.github.com/repos/rcourtman/Pulse/releases/latest | grep " tag_name" | awk ' {print substr($2, 3, length($2)-4) }' )
35
- temp_file=$( mktemp)
36
- mkdir -p /opt/pulse
37
- curl -fsSL " https://github.com/rcourtman/Pulse/releases/download/v${RELEASE} /pulse-v${RELEASE} .tar.gz" -o " $temp_file "
38
- tar zxf " $temp_file " --strip-components=1 -C /opt/pulse
39
- touch /opt/pulse/.env
40
- chown pulse:pulse /opt/pulse/.env
41
- echo " ${RELEASE} " > /opt/${APPLICATION} _version.txt
42
- msg_ok " Installed Pulse"
36
+ if [ -z " $LATEST_VERSION " ]; then
37
+ msg_error " Failed to get latest release info"
38
+ exit 1
39
+ fi
40
+
41
+ msg_ok " Latest version: $LATEST_VERSION "
43
42
44
- msg_info " Setting permissions for /opt/pulse..."
45
- chown -R pulse:pulse " /opt/pulse"
46
- find " /opt/pulse" -type d -exec chmod 755 {} \;
47
- find " /opt/pulse" -type f -exec chmod 644 {} \;
48
- msg_ok " Set permissions."
43
+ # Install Pulse v4 (Go version)
44
+ msg_info " Installing Pulse"
45
+ mkdir -p /opt/pulse
46
+ cd /opt/pulse
49
47
50
- msg_info " Creating Service "
51
- cat << EOF >/etc/systemd/system/pulse.service
52
- [Unit]
53
- Description=Pulse Monitoring Application
54
- After=network.target
48
+ # Download universal package
49
+ temp_file= $( mktemp )
50
+ curl -fsSL " https://github.com/rcourtman/Pulse/releases/download/ ${LATEST_VERSION} /pulse- ${LATEST_VERSION} .tar.gz " -o " $temp_file "
51
+ tar -xzf " $temp_file "
52
+ rm -f " $temp_file "
55
53
56
- [Service]
57
- Type=simple
58
- User=pulse
59
- Group=pulse
60
- WorkingDirectory=/opt/pulse
61
- EnvironmentFile=/opt/pulse/.env
62
- ExecStart=/usr/bin/npm run start
63
- Restart=on-failure
64
- RestartSec=5
65
- StandardOutput=journal
66
- StandardError=journal
54
+ # Set version file for update script compatibility
55
+ echo " ${LATEST_VERSION# v} " > /opt/${APPLICATION} _version.txt
67
56
68
- [Install]
69
- WantedBy=multi-user.target
70
- EOF
71
- systemctl enable -q --now pulse
72
- msg_ok " Created Service"
57
+ # Run the installer
58
+ if [ -f install.sh ]; then
59
+ bash install.sh
60
+ else
61
+ msg_error " Installer not found in package"
62
+ exit 1
63
+ fi
73
64
74
65
motd_ssh
75
66
customize
76
67
77
68
msg_info " Cleaning up"
78
- rm -f " $temp_file "
79
69
$STD apt-get -y autoremove
80
70
$STD apt-get -y autoclean
81
- msg_ok " Cleaned"
71
+ msg_ok " Cleaned"
0 commit comments