#!/bin/bash

INSTALL=install
ANS=z

echo "Installing webcamd configuration files in your ~/.webcamd directory"
echo
echo "THIS WILL ERASE YOUR EXISTING CONFIGURATIONS FILES"

while [ $ANS != "y" -a $ANS != "n" ]
do
echo -n "Are you sure you want to do this ? [y/n] "
read ANS;
done

if [ $ANS == "y" ] 
then
	$INSTALL -m 700 -d $HOME/.webcamd/
	$INSTALL -m 600 /usr/share/doc/webcamd/examples/index_up.html $HOME/.webcamd/
	$INSTALL -m 600 /usr/share/doc/webcamd/examples/index_down.html $HOME/.webcamd/
	$INSTALL -m 600 /usr/share/doc/webcamd/examples/webcamd.conf $HOME/.webcamd/
echo
echo "Installation done."

else 
echo "Ok, nothing was done"

fi