campus-total-block/Makefile

49 lines
2.4 KiB
Makefile

all:
echo OK
install:
mkdir -p /etc/squid/bin
cp -vf dst-domain-match-check.rb /etc/squid/bin/
cp -vf user-list-dst-domain-match-check.rb /etc/squid/bin/
stat /etc/squid/dst-total-block-check.ini || cp -vf dst-total-block-check.ini /etc/squid/dst-total-block-check.ini;true
stat /etc/squid/campus-testing-blacklist-check.ini || cp -vf campus-testing-blacklist-check.ini /etc/squid/;true
stat /etc/squid/campus-testing-whitelist-check.ini || cp -vf campus-testing-whitelist-check.ini /etc/squid/;true
stat /etc/squid/campus-whitelist-check.ini || cp -vf campus-whitelist-check.ini /etc/squid/;true
stat /etc/squid/campus-blacklist-check.ini || cp -vf campus-blacklist-check.ini /etc/squid/;true
stat /etc/squid/users-blacklist.ini || cp -vf users-blacklist.ini /etc/squid/;true
stat /etc/squid/users-whitelist.ini || cp -vf users-whitelist.ini /etc/squid/;true
chmod +x /etc/squid/bin/dst-domain-match-check.rb
chmod +x /etc/squid/bin/user-list-dst-domain-match-check.rb
install-debian-dependencies:
apt update
apt install -y ruby ruby-mysql2
gem install ipaddress
gem install inifile
install-services:
cp -vf dst-total-block.service /etc/systemd/system/
cp -vf campus-testing-whitelist-check.service /etc/systemd/system/
cp -vf campus-testing-blacklist-check.service /etc/systemd/system/
cp -vf campus-whitelist-check.service /etc/systemd/system/
cp -vf campus-blacklist-check.service /etc/systemd/system/
cp -vf users-blacklist.service /etc/systemd/system/
cp -vf users-whitelist.service /etc/systemd/system/
systemctl daemon-reload
start-services:
systemctl start dst-total-block campus-testing-whitelist-check campus-testing-blacklist-check campus-whitelist-check campus-blacklist-check users-whitelist users-blacklist
stop-services:
systemctl start dst-total-block campus-testing-whitelist-check campus-testing-blacklist-check campus-whitelist-check campus-blacklist-check users-whitelist users-blacklist
enable-services:
systemctl enable dst-total-block campus-testing-whitelist-check campus-testing-blacklist-check campus-whitelist-check campus-blacklist-check users-whitelist users-blacklist
restart-services:
systemctl restart dst-total-block campus-testing-whitelist-check campus-testing-blacklist-check campus-whitelist-check campus-blacklist-check users-whitelist users-blacklist
cleanup-sockets:
rm -vf /tmp/campus-*
rm -vf /tmp/users-*
rm -vf /tmp/total-block