add systemd service, timer files
This commit is contained in:
		
							parent
							
								
									49f47cb990
								
							
						
					
					
						commit
						5438db66ed
					
				
							
								
								
									
										23
									
								
								install.sh
								
								
								
								
							
							
						
						
									
										23
									
								
								install.sh
								
								
								
								
							| 
						 | 
				
			
			@ -1,11 +1,26 @@
 | 
			
		|||
#!/bin/sh
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
_user_id=$(id -u)
 | 
			
		||||
 | 
			
		||||
if ! [ "$_user_id" -eq 0 ] ; then
 | 
			
		||||
  echo "pacman-update-count.sh: insufficient priviliges: must be run as root"
 | 
			
		||||
if [ "$_user_id" -eq 0 ] ; then
 | 
			
		||||
  echo "pacman-update-count.sh: error - must be run as normal user, not root"
 | 
			
		||||
  exit 1
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
cp ./notify-updates /usr/local/bin/
 | 
			
		||||
cp ./pacman-update-count /usr/local/bin/
 | 
			
		||||
sudo cp ./notify-updates /usr/local/bin/
 | 
			
		||||
sudo cp ./pacman-update-count /usr/local/bin/
 | 
			
		||||
 | 
			
		||||
sudo cp ./pacman-update-count.* /etc/systemd/system/
 | 
			
		||||
 | 
			
		||||
mkdir -p ~/.config/systemd/user
 | 
			
		||||
cp ./update-notifier.* ~/.config/systemd/user
 | 
			
		||||
 | 
			
		||||
sudo systemctl daemon-reload
 | 
			
		||||
 | 
			
		||||
sudo systemctl enable pacman-update-count.timer
 | 
			
		||||
sudo systemctl start pacman-update-count.timer
 | 
			
		||||
 | 
			
		||||
systemctl --user enable update-notifier.timer
 | 
			
		||||
systemctl --user start update-notifier.timer
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,9 @@
 | 
			
		|||
[Unit]
 | 
			
		||||
Description=Update package update count (used by update-notifier)
 | 
			
		||||
 | 
			
		||||
[Service]
 | 
			
		||||
ExecStart=/usr/local/bin/pacman-update-count
 | 
			
		||||
 | 
			
		||||
[Install]
 | 
			
		||||
WantedBy=default.target
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,10 @@
 | 
			
		|||
[Unit]
 | 
			
		||||
Description=Periodically run pacman-update-count
 | 
			
		||||
 | 
			
		||||
[Timer]
 | 
			
		||||
OnBootSec=55minutes
 | 
			
		||||
OnActiveSec=1sec
 | 
			
		||||
OnUnitActiveSec=110minutes
 | 
			
		||||
 | 
			
		||||
[Install]
 | 
			
		||||
WantedBy=timers.target
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,9 @@
 | 
			
		|||
[Unit]
 | 
			
		||||
Description=Notify when updates are available
 | 
			
		||||
 | 
			
		||||
[Service]
 | 
			
		||||
ExecStart=/usr/local/bin/notify-updates -n
 | 
			
		||||
 | 
			
		||||
[Install]
 | 
			
		||||
WantedBy=default.target
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,10 @@
 | 
			
		|||
[Unit]
 | 
			
		||||
Description=Periodically run update-notifier
 | 
			
		||||
 | 
			
		||||
[Timer]
 | 
			
		||||
OnBootSec=1hour
 | 
			
		||||
OnActiveSec=1sec
 | 
			
		||||
OnUnitActiveSec=2hours
 | 
			
		||||
 | 
			
		||||
[Install]
 | 
			
		||||
WantedBy=timers.target
 | 
			
		||||
		Loading…
	
		Reference in New Issue