-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
32 lines (23 loc) · 1.66 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
CC ?= g++
CFLAGS = -g -Wall -Wextra -Wformat-security -O3 -fstack-protector-all
LIBS = -lnetfilter_queue -lnfnetlink
PROGRAM = webfilter-ng
SOURCE = webfilter-ng.c
all: webfilter-ng
webfilter-ng: webfilter-ng.c
$(CC) $(SOURCE) $(CFLAGS) $(LIBS) -o $(PROGRAM)
cp -pf webfilter-ng.service /tmp/
squidguard:
chmod a+x squidGuardWebGuard; rm -f webGuard 2>/dev/null ; cp -pf squidGuardWebGuard webGuard; cp -pf webfilter-ng.service /tmp/
dns:
chmod a+x dnsWebGuard; rm -f webGuard 2>/dev/null ; cp -pf dnsWebGuard webGuard; cp -pf webfilter-ng.service /tmp/
dns_categorify:
chmod a+x dnsCategorifyWebGuard; rm -f webGuard 2>/dev/null ; cp -pf dnsCategorifyWebGuard webGuard; cp -pf webfilter-ng.service /tmp/ ; sed -e 's/After=/After=redis-server.service\nRequires=redis-server.service\nAfter=nghttpx.service\nRequires=nghttpx.service\nAfter=/g' -i /tmp/webfilter-ng.service
list:
chmod a+x listWebGuard; rm -f webGuard 2>/dev/null ; cp -pf listWebGuard webGuard; cp -pf webfilter-ng.service /tmp/
uninstall:
systemctl daemon-reload; systemctl stop webfilter-ng; systemctl disable webfilter-ng.service; rm -f /usr/sbin/$(PROGRAM); rm -f /usr/bin/webGuard; rm -f /etc/systemd/system/webfilter-ng.service
install: uninstall
mkdir /etc/webfilter-ng; cp -pf $(PROGRAM) /usr/sbin/ ; cp -pf /tmp/webfilter-ng.service /etc/systemd/system/ ; systemctl daemon-reload ;mkdir /var/cache/webfilter-ng/ ; (! [ -f webGuard ] ) && cp -pf dnsWebGuard webGuard ; cp -pf webGuard /usr/bin/ ; chmod a+x /usr/bin/webGuard; chmod u+x /usr/sbin/$(PROGRAM) ; systemctl daemon-reload ; systemctl start webfilter-ng; systemctl enable webfilter-ng.service
clean:
@rm -rf $(PROGRAM); rm -f webGuard