2020-04-29 22:35:27 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								## Run BGPalerter as a Linux Service
 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-28 21:28:17 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								If you are interested in running this application as a service on a Linux server here is a basic guide covering how to do that.  This process works for RHEL 7 based Linux installations.  It will likely work very similiarly on other systemctl enabled installations.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								### Create directory for the application to reside
 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-18 18:05:52 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								Create a user for BGPalerter
							 
						 
					
						
							
								
									
										
										
										
											2020-04-28 21:28:17 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-08 19:08:55 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								```shell
							 
						 
					
						
							
								
									
										
										
										
											2020-05-18 18:05:52 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								adduser bgpalerter
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
									
										
										
										
											2020-04-28 21:28:17 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-08 19:08:55 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								**If this is a new installation:**
							 
						 
					
						
							
								
									
										
										
										
											2020-04-30 00:34:40 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-08 19:08:55 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								*  download the BGPalerter binary in the home of the newly created user:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    ```shell
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    sudo su bgpalerter
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    cd /home/bgpalerter
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    wget https://github.com/nttgin/BGPalerter/releases/latest/download/bgpalerter-linux-x64
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    chmod +x bgpalerter-linux-x64
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    ```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								*  execute it and proceed with the auto-configuration, at the end of which all the needed files will be created:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    ```shell
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    ./bgpalerter-linux-x64
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    ```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								**If this is an existing installation:**
							 
						 
					
						
							
								
									
										
										
										
											2020-04-30 00:34:40 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-08 19:08:55 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								*  simply move the files of your existing installation into this directory and assign the correct permissions
							 
						 
					
						
							
								
									
										
										
										
											2020-04-30 00:34:40 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-08 19:08:55 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    ```shell
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    mv /your/old/bgpalerter /home/bgpalerter
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    chown -R bgpalerter:bgpalerter /home/bgpalerter
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    chmod -x /home/bgpalerter/bgpalerter-linux-x64
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    ```
							 
						 
					
						
							
								
									
										
										
										
											2020-04-28 21:28:17 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								### Create systemd service file
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Next you need to create the systemd service file.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-18 18:05:52 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								`sudo vi /etc/systemd/system/bgpalerter.service` 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-28 21:28:17 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								The contents of this file should be as follows:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								[Unit]
							 
						 
					
						
							
								
									
										
										
										
											2020-04-29 22:35:27 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								Description=BGPalerter
							 
						 
					
						
							
								
									
										
										
										
											2020-04-28 21:28:17 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								After=network.target
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								[Service]
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Type=simple
							 
						 
					
						
							
								
									
										
										
										
											2020-05-18 18:05:52 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								Restart=on-failure
							 
						 
					
						
							
								
									
										
										
										
											2022-02-08 19:08:55 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								RestartSec=30s
							 
						 
					
						
							
								
									
										
										
										
											2020-05-18 18:05:52 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								User=bgpalerter
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								WorkingDirectory=/home/bgpalerter
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								ExecStart=/home/bgpalerter/bgpalerter-linux-x64
							 
						 
					
						
							
								
									
										
										
										
											2020-04-28 21:28:17 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								[Install]
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								WantedBy=multi-user.target
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								### Reload systemd
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Reload systemd to register the new configuration.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`systemctl daemon-reload` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								### Enable and start the service
 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-29 22:35:27 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								Enable BGPalerter to start at boot and then start the service.
							 
						 
					
						
							
								
									
										
										
										
											2020-04-28 21:28:17 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`systemctl enable bgpalerter` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								`systemctl start bgpalerter` 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-02 11:54:10 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								### Automatic Updates
 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-08 19:08:55 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								You can enable automatic updates by following the instructions below.
							 
						 
					
						
							
								
									
										
										
										
											2020-08-02 11:54:10 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-08 19:08:55 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								Enter as bgpalerter user in its home directory:
							 
						 
					
						
							
								
									
										
										
										
											2020-08-02 11:54:10 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-08 19:08:55 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								```shell
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								sudo su bgpalerter
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								cd /home/bgpalerter
							 
						 
					
						
							
								
									
										
										
										
											2020-08-02 11:54:10 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-08 19:08:55 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								Create a file `upgrade.sh`  with the following content:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```shell
							 
						 
					
						
							
								
									
										
										
										
											2020-08-02 11:54:10 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								#!/usr/bin/env bash
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-08 19:08:55 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# Change the directories if needed
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								DIR=/home/bgpalerter
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								LOGS=$DIR/logs
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# If log file does not exist, create it
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								if [ ! -f $LOGS/upgrade.log ]; then
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  touch $LOGS/upgrade.log
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  chown bgpalerter:bgpalerter $LOGS/upgrade.log
							 
						 
					
						
							
								
									
										
										
										
											2020-08-02 11:54:10 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								fi
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-08 19:08:55 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# Delete log file if larger than 5MB
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								find $LOGS -type f -name "upgrade.log" -size +5M -delete
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								exec 1> $LOGS/upgrade.log 2>&1
							 
						 
					
						
							
								
									
										
										
										
											2020-08-02 11:54:10 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-08 19:08:55 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								cd $DIR
							 
						 
					
						
							
								
									
										
										
										
											2020-08-02 11:54:10 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-08 19:08:55 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# Download the latest version and save it to a temp file
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								wget --no-verbose -O bgpalerter-linux-x64.tmp https://github.com/nttgin/BGPalerter/releases/latest/download/bgpalerter-linux-x64
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# Set permissions to execute the file
 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-02 11:54:10 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								chmod +x bgpalerter-linux-x64.tmp
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-08 19:08:55 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# Set variables to compare versions
 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-02 11:54:10 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								if [ -f bgpalerter-linux-x64 ]; then
							 
						 
					
						
							
								
									
										
										
										
											2022-02-08 19:08:55 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  # If a file exists already
							 
						 
					
						
							
								
									
										
										
										
											2020-08-02 11:54:10 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  v1=$(./bgpalerter-linux-x64 -v)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  v2=$(./bgpalerter-linux-x64.tmp -v)
							 
						 
					
						
							
								
									
										
										
										
											2022-02-08 19:08:55 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  
							 
						 
					
						
							
								
									
										
										
										
											2020-08-02 11:54:10 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								else
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  v1=$"0"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  v2=$(./bgpalerter-linux-x64.tmp -v)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								fi
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-08 19:08:55 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# If there is no old version
 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-02 11:54:10 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								if [ "$v1" == "0" ];then
							 
						 
					
						
							
								
									
										
										
										
											2022-02-08 19:08:55 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  #Remove  the file
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  rm bgpalerter-linux-x64.tmp
							 
						 
					
						
							
								
									
										
										
										
											2020-08-02 11:54:10 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-08 19:08:55 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  echo "This script upgrades BGPalerter; however, $DIR/bgpalerter-linux-x64 cannot be found. Please, install it first https://github.com/nttgin/BGPalerter/blob/main/docs/linux-service.md"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  exit 1
							 
						 
					
						
							
								
									
										
										
										
											2020-08-02 11:54:10 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-08 19:08:55 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# The versions are different
 
							 
						 
					
						
							
								
									
										
										
										
											2020-08-02 11:54:10 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								elif [ "$v1" != "$v2" ];then
							 
						 
					
						
							
								
									
										
										
										
											2022-02-08 19:08:55 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  # Remove the old version
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  rm bgpalerter-linux-x64
							 
						 
					
						
							
								
									
										
										
										
											2020-08-02 11:54:10 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-08 19:08:55 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  # Rename the temp file
							 
						 
					
						
							
								
									
										
										
										
											2020-08-02 11:54:10 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  mv bgpalerter-linux-x64.tmp bgpalerter-linux-x64
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-08 19:08:55 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  # Kill the process 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  # We use kill because "systemctl restart bgpalerter" works only 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  # if you run this script as root. Systemctl will restart the process.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  kill -9 $(cat $DIR/bgpalerter.pid) || true
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  echo "A new version of BGPalerter has been installed"
							 
						 
					
						
							
								
									
										
										
										
											2020-08-02 11:54:10 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								else
							 
						 
					
						
							
								
									
										
										
										
											2022-02-08 19:08:55 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  # If the versions are the same, delete the temp file
							 
						 
					
						
							
								
									
										
										
										
											2020-08-02 11:54:10 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  rm bgpalerter-linux-x64.tmp
							 
						 
					
						
							
								
									
										
										
										
											2022-02-08 19:08:55 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  echo "BGPalerter is up to date"
							 
						 
					
						
							
								
									
										
										
										
											2020-08-02 11:54:10 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								fi
							 
						 
					
						
							
								
									
										
										
										
											2022-02-08 19:08:55 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
									
										
										
										
											2020-08-02 11:54:10 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-08 19:08:55 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								The `upgrade.sh`  file needs to be executable
							 
						 
					
						
							
								
									
										
										
										
											2020-08-02 11:54:10 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-08 19:08:55 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								```shell
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								chmod +x upgrade.sh
							 
						 
					
						
							
								
									
										
										
										
											2020-08-02 11:54:10 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-08 19:08:55 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								Now we need to configure a cron job to periodically execute `upgrade.sh` .
							 
						 
					
						
							
								
									
										
										
										
											2020-08-02 11:54:10 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-08 19:08:55 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								As the `bgpalerter`  user, do
							 
						 
					
						
							
								
									
										
										
										
											2020-08-02 11:54:10 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-08 19:08:55 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								```shell
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								crontab -e
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								and append the following line to perform the check weekly
							 
						 
					
						
							
								
									
										
										
										
											2020-08-02 11:54:10 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
									
										
										
										
											2022-02-08 19:08:55 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								0 0 *   *  0 /home/bgpalerter/upgrade.sh
							 
						 
					
						
							
								
									
										
										
										
											2020-08-02 11:54:10 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								```