Last active
August 29, 2015 14:08
-
-
Save kanazux/ff610265b1a0b9d33df4 to your computer and use it in GitHub Desktop.
Packet installer for txz files used by web filter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Author: Silvio Giunge a.k.a Kanazuchi | |
# 1410180880 | |
# a2FuYXp1Y2hpQGFsdm9saXZyZS5jb20=# Install packages for webfilter | |
# | |
SAMBAPATH="/var/run/samba4" | |
CONFPATH="/usr/local/etc" | |
SQUIDPATH="/usr/local/etc/squid" | |
cat dep_txz_packets | xargs -I % pkg add -f txz_files/% | |
[ ! -d ${SAMBAPATH} ] && mkdir /var/run/samba4 | |
[ ! -d "/var/run/samba" ] && mkdir /var/run/samba | |
if [ ! -d "$SAMBAPATH/winbindd_privileged" ]; then | |
mkdir /var/run/samba4/winbindd_privileged | |
chmod 0755 /var/run/samba4/winbindd_privileged | |
fi | |
[ ! -d "$SAMBAPATH/winbindd" ] && mkdir /var/run/samba4/winbindd | |
cp -v conf_files/smb4.conf /usr/local/etc/ | |
echo 'smbd_enable="YES"' >> /etc/rc.conf | |
echo 'nmbd_enable="YES"' >> /etc/rc.conf | |
echo 'winbindd_enable="YES"' >> /etc/rc.conf | |
echo 'samba_server_enable="YES"' >> /etc/rc.conf | |
[ ! -e "/usr/local/lib/libgnutls.so.26" ] && ln -s /usr/local/lib/libgnutls.so.28 /usr/local/lib/libgnutls.so.26 | |
[ ! -e "/usr/local/lib/libtasn1.so.7" ] && ln -s /usr/local/lib/libtasn1.so.6 /usr/local/lib/libtasn1.so.7 | |
[ ! -e "/lib/libreadline.so.6" ] && ln -s /lib/libreadline.so.8 /lib/libreadline.so.6 | |
cp -v conf_files/krb5.conf /etc/ | |
cp -v conf_files/nsswitch.conf /etc/ | |
echo "0.0.0.0 domain" >> /etc/hosts | |
echo "senha" | /usr/local/bin/kinit auth@domain | |
net ads join -U auth%senha | |
service samba_server restart | |
[ ! -d "/var/squid/cache" ] && mkdir /var/squid/cache | |
chown -R proxy:proxy /var/squid/cache/ | |
chown -R proxy:proxy /var/squid/logs | |
[ ! -d "/usr/local/etc/squid/certificates" ] && mkdir /usr/local/etc/squid/certificates | |
chown -R proxy:proxy /usr/local/etc/squid/certificates | |
openssl genrsa 2048 > "$SQUIDPATH/certificates/squidkey.pem" | |
echo -e "BR\nSao Paulo\nLimeira\nempresa\nBP\n*\[email protected]\n" | openssl req -new -x509 -days 3650 -key "$SQUIDPATH/certificates/squidkey.pem" -out "$SQUIDPATH/certificates/squidcrt.pem" | |
openssl x509 -in "$SQUIDPATH/certificates/squidcrt.pem" -outform DER -out "$SQUIDPATH/certificates/squid.der" | |
/usr/local/libexec/squid/ssl_crtd -c -s /usr/local/etc/squid/ssl_db | |
cp -v conf_files/squid.conf /usr/local/etc/squid | |
/usr/local/sbin/squid -z | |
/usr/local/sbin/squid -f /usr/local/etc/squid/squid.conf | |
/usr/local/bin/python2.7 create_files.py |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment