initial commit of file from CVS for smeserver-unifi on Sat Sep 7 21:10:32 AEST 2024
This commit is contained in:
28
root/sbin/e-smith/systemd/unifi
Normal file
28
root/sbin/e-smith/systemd/unifi
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
|
||||
# check if squid is using 8080, if yes, then move to 8081
|
||||
intercept=$(/usr/sbin/e-smith/config getprop squid InterceptPort||echo "8080")
|
||||
squidstatus=$(/usr/sbin/e-smith/config getprop squid status||echo "disabled")
|
||||
|
||||
if [[ "$intercept" == "8080" && "$squidstatus" == "enabled" ]]; then
|
||||
echo "we set squid Intercept port to 8081.. to avoid conflict with unifi "
|
||||
/usr/sbin/e-smith/config setprop squid InterceptPort 8081
|
||||
/usr/sbin/e-smith/expand-template /etc/squid/squid.conf
|
||||
/usr/sbin/e-smith/expand-template /etc/rc.d/init.d/masq
|
||||
/usr/bin/systemctl restart squid
|
||||
/usr/bin/systemctl restart masq
|
||||
|
||||
fi
|
||||
|
||||
# now deal with dansguardian
|
||||
dport=$(/usr/sbin/e-smith/config getprop dansguardian port ||echo "8080")
|
||||
dstatus=$(/usr/sbin/e-smith/config getprop dansguardian status||echo "disabled")
|
||||
if [[ "$dport" == "8080" && "$dsatus" == "enabled" ]]; then
|
||||
echo "we set dansguardian port to 8081.. to avoid conflict with unifi "
|
||||
/usr/sbin/e-smith/config setprop dansguardian port 8081
|
||||
/usr/sbin/e-smith/expand-template /etc/dansguardian/dansguardian.conf
|
||||
/usr/bin/systemctl restart dansguardian
|
||||
fi
|
||||
|
||||
# nothing to do with with squidguard
|
||||
|
Reference in New Issue
Block a user