#!/bin/bash


while true;do

  echo "[1] - Install Tux"
  echo "[2] - Remove Tux"
  echo
  echo "[q] - Quit"
  echo
  echo -n "~$: "
  read choice

  if [ "${choice}" = "1" ];then
    sudo apt-get install ruby git
    mkdir -p /home/$USER/.tux
    cd .tux
    git clone https://gitlab.com/silvernode/tux.git
    echo "Creating synlink to Tux"
    sudo ln -s /home/$USER/.tux/tux/tux.rb /usr/bin/tux
    if [ -f /usr/bin/tux ];then
      tuxbin=$(which tux)
      echo "Tux is symlinked in: ${tuxbin}"
      exit 0;
    else
      echo "Could not find tux, installation failed faggot"
      exit 0;
    fi

  elif [ "${choice}" = "2" ];then
    if [ -d /home/$USER/.tux ];then
      rm -r /home/$USER/.tux
      sudo rm /usr/bin/tux
      if [ ! -d /home/$USER/.tux ];then
        echo "Tux is fucking gone"
        exit 0;
      else
        echo "Tux is still fucking there"
        exit 0;
      fi
   else
     echo "There was some issue installing this shit"
     exit 0;
   fi
      
  fi 

done
