[ create a new paste ] login | about

Link: http://codepad.org/KI9jochP    [ raw code | output | fork ]

Haskell, pasted on Mar 10:
function znc_another_dir {
	yourch=
    until [ "$yourch" = "0" ]; do
	echo -e ""
	echo "   Please enter the folder where you wuld like to install ZNC";
	echo -e "";
	read -p '   ' -e install_dir; 
	if [[ $install_dir != *//* || $install_dir = *[!/[:lower:]]* ]]; then
	 echo -e ""
	 echo "   Invalid dir, try again"	
     echo "   Valid dir can contain a-z 0-9 and /"
	 sleep 5; 
	 continue; 
	fi
	 echo -e "";
	 echo "   ZNC will be isntalled to this folder \"$install_dir\"";
	 sleep 5;
  break
done
}

    yourch=
    until [ "$yourch" = "0" ]; do
    clear
    echo -e ""
    echo "   ZNC will by defult be installed to your home dir"
    echo "   If you wish to install it to another dir then"
    echo "   Just take the option two in the menu"
	echo ""
	echo -e "  $yellow Type the number of your choice$endcolor"
	echo ""
	echo "   [1] HomeDir"
    echo "   [2] AnotherDir"
    echo "   [3] Quit installer"
    echo "   ======================="
    echo -n "   Enter your menu choice [1-3]: "
    read yourch
    case $yourch in
      1) echo -e "";
    	 echo "   ZNC will be installed in your home folder \"$home/znc\"";
    	 install_dir='0';
         echo -e "";
         sleep 5;;
      2) znc_another_dir;;
      3) quit 0 ;;
      *) echo "";
    	 echo "   Invalid option";
         echo "   Press a key.to continue.." ; echo -e "" && echo -n '   ' && read;;
	esac
  break
done


Output:
1
2
Error occurred
ERROR line 1 - Syntax error in declaration (unexpected `{', possibly due to bad layout)


Create a new paste based on this one


Comments: