#!/bin/bash

HOSTNAME=$(cat /etc/hostname)

# delete unnecessary files
if [[ $HOSTNAME == "raspberrypi" ]]; then

  rm -rf python_games
  apt-get purge -y x11-common midori lxde python3 python3-minimal
  apt-get purge -y lxde-common lxde-icon-theme omxplayer
  apt-get purge -y wolfram-engine

  apt-get autoremove --purge -y
  apt-get update -y

  #Do not upgrade for now as lsb_release -si starts returning non "Debian" value
  #which brakes pi owncloud installation, need to check
  #apt-get upgrade -y

  rm -Rf /etc/X11
  rm -Rf /etc/wpa_supplicant
  rm -Rf /usr/share/icons
  rm -Rf /home/pi/Desktop
  rm -f /home/pi/ocr_pi.png
fi
