mirror of
				https://github.com/community-scripts/ProxmoxVE.git
				synced 2025-11-04 10:22:50 +00:00 
			
		
		
		
	Pulse: standardise install/update with Pulse repo script (#7519)
- revert the pulse => pulse-backend service name change - remove message about older installs - symlink pulse binary to /usr/local/bin
This commit is contained in:
		
							
								
								
									
										13
									
								
								ct/pulse.sh
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								ct/pulse.sh
									
									
									
									
									
								
							@@ -28,10 +28,6 @@ function update_script() {
 | 
				
			|||||||
    exit
 | 
					    exit
 | 
				
			||||||
  fi
 | 
					  fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if [[ ! -f ~/.pulse ]]; then
 | 
					 | 
				
			||||||
    msg_error "Old Installation Found! Please recreate the container due big changes in the software."
 | 
					 | 
				
			||||||
    exit 1
 | 
					 | 
				
			||||||
  fi
 | 
					 | 
				
			||||||
  if check_for_gh_release "pulse" "rcourtman/Pulse"; then
 | 
					  if check_for_gh_release "pulse" "rcourtman/Pulse"; then
 | 
				
			||||||
    SERVICE_PATH="/etc/systemd/system"
 | 
					    SERVICE_PATH="/etc/systemd/system"
 | 
				
			||||||
    msg_info "Stopping Services"
 | 
					    msg_info "Stopping Services"
 | 
				
			||||||
@@ -43,19 +39,20 @@ function update_script() {
 | 
				
			|||||||
    fi
 | 
					    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    fetch_and_deploy_gh_release "pulse" "rcourtman/Pulse" "prebuild" "latest" "/opt/pulse" "*-linux-amd64.tar.gz"
 | 
					    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
 | 
					    chown -R pulse:pulse /etc/pulse /opt/pulse
 | 
				
			||||||
    if [[ -f "$SERVICE_PATH"/pulse.service ]]; then
 | 
					    if [[ -f "$SERVICE_PATH"/pulse-backend.service ]]; then
 | 
				
			||||||
      mv "$SERVICE_PATH"/pulse.service "$SERVICE_PATH"/pulse-backend.service
 | 
					      mv "$SERVICE_PATH"/pulse-backend.service "$SERVICE_PATH"/pulse.service
 | 
				
			||||||
    fi
 | 
					    fi
 | 
				
			||||||
    sed -i -e 's|pulse/pulse|pulse/bin/pulse|' \
 | 
					    sed -i -e 's|pulse/pulse|pulse/bin/pulse|' \
 | 
				
			||||||
      -e 's/^Environment="API.*$//' "$SERVICE_PATH"/pulse-backend.service
 | 
					      -e 's/^Environment="API.*$//' "$SERVICE_PATH"/pulse.service
 | 
				
			||||||
    systemctl daemon-reload
 | 
					    systemctl daemon-reload
 | 
				
			||||||
    if grep -q 'pulse-home:/bin/bash' /etc/passwd; then
 | 
					    if grep -q 'pulse-home:/bin/bash' /etc/passwd; then
 | 
				
			||||||
      usermod -s /usr/sbin/nologin pulse
 | 
					      usermod -s /usr/sbin/nologin pulse
 | 
				
			||||||
    fi
 | 
					    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    msg_info "Starting Services"
 | 
					    msg_info "Starting Services"
 | 
				
			||||||
    systemctl start pulse-backend
 | 
					    systemctl start pulse
 | 
				
			||||||
    msg_ok "Started Services"
 | 
					    msg_ok "Started Services"
 | 
				
			||||||
    msg_ok "Updated Successfully"
 | 
					    msg_ok "Updated Successfully"
 | 
				
			||||||
  fi
 | 
					  fi
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -30,11 +30,12 @@ fi
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
mkdir -p /etc/pulse
 | 
					mkdir -p /etc/pulse
 | 
				
			||||||
fetch_and_deploy_gh_release "pulse" "rcourtman/Pulse" "prebuild" "latest" "/opt/pulse" "*-linux-amd64.tar.gz"
 | 
					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
 | 
					chown -R pulse:pulse /etc/pulse /opt/pulse
 | 
				
			||||||
msg_ok "Installed Pulse"
 | 
					msg_ok "Installed Pulse"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
msg_info "Creating Service"
 | 
					msg_info "Creating Service"
 | 
				
			||||||
cat <<EOF >/etc/systemd/system/pulse-backend.service
 | 
					cat <<EOF >/etc/systemd/system/pulse.service
 | 
				
			||||||
[Unit]
 | 
					[Unit]
 | 
				
			||||||
Description=Pulse Monitoring Server
 | 
					Description=Pulse Monitoring Server
 | 
				
			||||||
After=network.target
 | 
					After=network.target
 | 
				
			||||||
@@ -55,7 +56,7 @@ Environment="PULSE_DATA_DIR=/etc/pulse"
 | 
				
			|||||||
[Install]
 | 
					[Install]
 | 
				
			||||||
WantedBy=multi-user.target
 | 
					WantedBy=multi-user.target
 | 
				
			||||||
EOF
 | 
					EOF
 | 
				
			||||||
systemctl enable -q --now pulse-backend
 | 
					systemctl enable -q --now pulse
 | 
				
			||||||
msg_ok "Created Service"
 | 
					msg_ok "Created Service"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
motd_ssh
 | 
					motd_ssh
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user