Files

69 lines
1.5 KiB
Bash
Raw Permalink Normal View History

2025-05-27 09:04:00 +02:00
#!/usr/bin/env bash
# Copyright (c) 2021-2025 community-scripts ORG
# Author: rcourtman & vhsdream
2025-05-27 09:04:00 +02:00
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/rcourtman/Pulse
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
msg_info "Installing Dependencies"
$STD apt-get install -y \
diffutils \
policykit-1
msg_ok "Installed Dependencies"
2025-05-27 09:04:00 +02:00
msg_info "Creating User"
if useradd -r -m -d /opt/pulse-home -s /usr/sbin/nologin pulse; then
msg_ok "Created User"
2025-05-27 09:04:00 +02:00
else
msg_error "User creation failed"
2025-05-27 09:04:00 +02:00
exit 1
fi
2025-08-06 10:53:41 +02:00
mkdir -p /etc/pulse
fetch_and_deploy_gh_release "pulse" "rcourtman/Pulse" "prebuild" "latest" "/opt/pulse" "*-linux-amd64.tar.gz"
ln -sf /opt/pulse/bin/pulse /usr/local/bin/pulse
chown -R pulse:pulse /etc/pulse /opt/pulse
2025-05-27 09:04:00 +02:00
msg_ok "Installed Pulse"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/pulse.service
2025-05-27 09:04:00 +02:00
[Unit]
Description=Pulse Monitoring Server
2025-05-27 09:04:00 +02:00
After=network.target
[Service]
Type=simple
User=pulse
Group=pulse
WorkingDirectory=/opt/pulse
2025-08-14 17:41:36 -04:00
ExecStart=/opt/pulse/bin/pulse
Restart=always
RestartSec=3
2025-05-27 09:04:00 +02:00
StandardOutput=journal
StandardError=journal
Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
Environment="PULSE_DATA_DIR=/etc/pulse"
2025-05-27 09:04:00 +02:00
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now pulse
2025-05-27 09:04:00 +02:00
msg_ok "Created Service"
motd_ssh
customize
msg_info "Cleaning up"
$STD apt-get -y autoremove
$STD apt-get -y autoclean
msg_ok "Cleaned"