# Instalation script for Lutel Firewall

script_path='/usr/sbin'
configuration_path='/etc'
distro='unknown'

[ -f /etc/gentoo-release ] && distro='gentoo'

if [ ! "$1" ]; then
 echo "This script will install LutelWall in the following directories:"
 echo " Main executable:    $script_path/lutelwall"
 echo " Configuration file: $configuration_path/lutelwall.conf"
 echo "Do you want to proceed (y/N)?"
 read -s -n 1 ln
 [ "$ln" != 'y' ] && exit
 echo
fi;

[ "$1" = "gentoo" ] && distro="gentoo"

echo "Installing LutelWall..."
echo
echo " Distribution identified as: $distro"
echo " Copying firewall script to $script_path/lutelwall"
 cp lutelwall $script_path/lutelwall
 chmod 0700 $script_path/lutelwall
 chown 0:0 $script_path/lutelwall
if [ ! -f $configuration_path/lutelwall.conf ]; then
 echo " Copying firewall config to $configuration_path/lutelwall.conf"
  cp lutelwall.conf $configuration_path/lutelwall.conf
  chmod 0600 $configuration_path/lutelwall.conf
  chown 0:0 $configuration_path/lutelwall.conf
fi;
echo
echo "LutelWall installed sucessfully."
echo "Edit your configuration file and start firewall (lutelwall start)"
