more scripts

This commit is contained in:
Grzegorz Surmann 2024-07-29 00:15:09 +00:00
parent 792a589daa
commit 6c2bfe74cb
2 changed files with 28 additions and 0 deletions

4
bin/install.sh Normal file → Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
export PATH

View File

@ -0,0 +1,24 @@
#!/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
export PATH
LANG="en_US.UTF-8"
export LANG
MYPATH="/opt/bgpblist"
MYUSER=$(whoami)
if [ ${MYUSER} != "root" ]; then
echo "*** USER IS NOT ROOT ***"
echo "*** WILL NOT UPDATE ****"
exit 1
fi
echo "*** START ***"
cd ${MYPATH} || ( echo "ERROR: could not change to dif"; exit 1 )
git pull
cp /opt/bgpblist/etc/systemd/bgpblacklist.service /etc/systemd/system/bgpblacklist.service
systemctl daemon-reload
systemctl restart bgpblacklist.service
echo "*** DONE ***"