Nessa parte sua soluçao funcionou perfeitamente, agora fiz algumas alteraçoes novas e esta exibindo um novo erro na line 79
#!/bin/bash
clear
while true; do
echo "==========================================================
Digite o número do componente a ser instalado:
1 - Configuração da rede
2 - Sourcers.list recomendada
3 - Samba 4, Cups, Dhcp
4 - Squid 3, Sarg, Ntop
5 - Apache2, Ftp, Sql, Moodle
6 - Postfix, Squirrelmail, Sql
0 - Sair
==========================================================="
echo -n "->OPÇÃO: "
read opcao
#verificar se foi digitada uma opcao
if [ -z $opcao ]; then
echo "ERRO: digite uma opcao"
exit
fi
case $opcao in
1)
echo source /etc/network/interfaces.d/* &&
echo auto lo >> /etc/network/interfaces &&
echo iface lo inet loopback >> /etc/network/interfaces &&
echo auto eth0 >> /etc/network/interfaces &&
echo iface eth0 inet dhcp >> /etc/network/interfaces &&
echo auto eth1 >> /etc/network/interfaces &&
echo iface eth1 inet static >> /etc/network/interfaces &&
echo address 192.168.0.4 >> /etc/network/interfaces &&
echo network 192.168.0.0 >> /etc/network/interfaces &&
echo netmask 255.255.255.0 >> /etc/network/interfaces &&
/etc/init.d/networking restart;;
2)
echo #------------------------------------------------------------------------------# /etc/apt/sourcers.list &&
echo # OFFICIAL DEBIAN REPOS # /etc/apt/sourcers.list &&
echo #------------------------------------------------------------------------------# /etc/apt/sourcers.list &&
echo ###### Debian Main Repos /etc/apt/sourcers.list &&
echo deb
http://ftp.br.debian.org/debian/ jessie main contrib non-free /etc/apt/sourcers.list &&
echo deb-src
http://ftp.br.debian.org/debian/ jessie main contrib non-free /etc/apt/sourcers.list &&
echo ###### Debian Update Repos /etc/apt/sourcers.list &&
echo deb
http://security.debian.org/ jessie/updates main contrib non-free /etc/apt/sourcers.list &&
echo deb
http://ftp.br.debian.org/debian/ jessie-proposed-updates main contrib non-free /etc/apt/sourcers.list &&
echo deb-src
http://security.debian.org/ jessie/updates main contrib non-free /etc/apt/sourcers.list &&
echo deb-src
http://ftp.br.debian.org/debian/ jessie-proposed-updates main contrib non-free /etc/apt/sourcers.list ;;
3)
wget -q
http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add - &&
sudo apt-get update &&
sudo apt-get install virtualbox;;
4)
apt-get update
apt-get upgrade
apt-get install squid3
cd /etc/squid3/
cp squid.conf squid.confbackup
rm squid.conf
echo acl SSL_ports port 443 >> /etc/squid3/squid.conf &&
echo acl Safe_ports port 80 # http >> /etc/squid3/squid.conf &&
echo acl Safe_ports port 21 # ftp >> /etc/squid3/squid.conf &&
echo acl Safe_ports port 443 # https >> /etc/squid3/squid.conf &&
echo acl Safe_ports port 70 # gopher >> /etc/squid3/squid.conf &&
echo acl Safe_ports port 210 # wais >> /etc/squid3/squid.conf &&
echo acl Safe_ports port 1025-65535 # unregistered ports >> /etc/squid3/squid.conf &&
echo acl Safe_ports port 280 # http-mgmt >> /etc/squid3/squid.conf &&
echo acl Safe_ports port 488 # gss-http >> /etc/squid3/squid.conf &&
echo acl Safe_ports port 591 # filemaker >> /etc/squid3/squid.conf &&
echo acl Safe_ports port 777 # multiling http >> /etc/squid3/squid.conf &&
echo acl CONNECT method CONNECT >> /etc/squid3/squid.conf &&
echo http_access allow localhost >> /etc/squid3/squid.conf &&
echo acl block url_regex -i "/etc/squid3/block.txt" >> /etc/squid3/squid.conf &&
echo http_access deny block >> /etc/squid3/squid.conf &&
echo http_access allow all >> /etc/squid3/squid.conf &&
echo refresh_pattern ^ftp: 1440 20% 10080 >> /etc/squid3/squid.conf &&
echo refresh_pattern ^gopher: 1440 0% 1440 >> /etc/squid3/squid.conf &&
echo refresh_pattern -i (/cgi-bin/|\?) 0 0% 0 >> /etc/squid3/squid.conf &&
echo refresh_pattern . 0 20% 4320 >> /etc/squid3/squid.conf &&
echo
www.facebook.com >> /etc/squid3/block.txt &&
echo
www.youtube.com >> /etc/squid3/block.txt &&
echo
www.gmail.com >> /etc/squid3/block.txt &&
echo #!/bin/bash >> /etc/init.d/compartilhar.sh &&
echo iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j REDIRECT --to-port 3128 >> /etc/init.d/compartilhar.sh &&
echo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE >> /etc/init.d/compartilhar.sh &&
echo echo 1 > /proc/sys/net/ipv4/ip_forward >> /etc/init.d/compartilhar.sh &&
echo echo 1 > /proc/sys/net/ipv4/ip_forward >> /etc/init.d/compartilhar.sh &&
/etc/init.d/squid3 restart;;
5)
apt-get update &&
apt-get upgrade &&
apt-get install apache2 mysql-server php5-mysql &&
mysql_install_db &&
mysql_secure_installation &&
apt-get install php5 libapache2-mod-php5 php5-mcrypt &&
rm /etc/apache2/mods-enabled/dir.conf &&
echo "<IfModule mod_dir.c>" >> /etc/apache2/mods-enabled/dir.conf &&
echo DirectoryIndex index.php index.cgi index.pl index.html index.xhtml index.htm /etc/apache2/mods-enabled/dir.conf >> /etc/apache2/mods-enabled/dir.conf &&
echo "</IfModule>" >> /etc/apache2/mods-enabled/dir.conf &&
service apache2 restart &&
mkdir /Moodle &&
chmod 777 /Moodle &&
cd /var/www/html/ &&
wget
https://download.moodle.org/download.php/stable31/moodle-latest-31.zip &&
apt-get install zip unzip &&
unzip moodle-latest-31.zip &&
0)
echo "Saindo..."
exit;;
*)
echo
echo "ERRO: opção inválida"
echo ;;
esac
done
Erro referente a esta line "echo refresh_pattern -i (/cgi-bin/|\?) 0 0% 0 >> /etc/squid3/squid.conf &&"