Add install-pingfinder.sh
This commit is contained in:
		
					parent
					
						
							
								be942ccbbc
							
						
					
				
			
			
				commit
				
					
						758558a753
					
				
			
		
					 1 changed files with 36 additions and 0 deletions
				
			
		
							
								
								
									
										36
									
								
								install-pingfinder.sh
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								install-pingfinder.sh
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,36 @@
 | 
			
		|||
#!/bin/sh
 | 
			
		||||
set -euo pipefail
 | 
			
		||||
 | 
			
		||||
read -p "Enter your pingfinder UUID: " pingfinder_uuid
 | 
			
		||||
 | 
			
		||||
cat <<EOF > /etc/systemd/system/pingfinder.service
 | 
			
		||||
[Unit]
 | 
			
		||||
Description=Pingfinder
 | 
			
		||||
 | 
			
		||||
[Service]
 | 
			
		||||
Type=oneshot
 | 
			
		||||
 | 
			
		||||
Environment=WARNLOCK=$CACHE_DIRECTORY/warn.lock
 | 
			
		||||
Environment=LOCKFILE=$CACHE_DIRECTORY/exec.lock
 | 
			
		||||
Environment=UUID=$pingfinder_uuid
 | 
			
		||||
ExecStart=/usr/local/bin/pingfinder.sh
 | 
			
		||||
 | 
			
		||||
DynamicUser=yes
 | 
			
		||||
CacheDirectory=pingfinder
 | 
			
		||||
EOF
 | 
			
		||||
 | 
			
		||||
cat <<EOF > /etc/systemd/system/pingfinder.timer
 | 
			
		||||
[Unit]
 | 
			
		||||
Description=Pingfind periodically
 | 
			
		||||
 | 
			
		||||
[Timer]
 | 
			
		||||
OnBootSec=1m
 | 
			
		||||
OnUnitActiveSec=1m
 | 
			
		||||
 | 
			
		||||
[Install]
 | 
			
		||||
WantedBy=timers.target
 | 
			
		||||
EOF
 | 
			
		||||
 | 
			
		||||
curl -JLo /usr/local/bin/pingfinder.sh https://git.m724.eu/Minecon724/dn42-configs/raw/branch/master/usr/local/bin/pingfinder.sh
 | 
			
		||||
 | 
			
		||||
systemctl enable pingfinder.timer
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue