alias decolor="perl -pe 's/\x1b\[[0-9;]*m//g'"
alias ls="ls --color=auto"

alias restart="/etc/init.d/biosmart restart"
alias tac="perl -e 'print reverse <>'"
alias llog="tail -f /var/log/biosmart"
alias tt="tail -fn1000 /var/log/biosmart"
alias tlog="cat /var/log/biosmart | decolor | less"
alias vic="vi /etc/prosoft-biometrics/BIOSMART\ PV\ WTC\ 2.conf"
alias tl="cat /var/log/biosmart | tail"

export LOG_FILE=/var/log/biosmart

function replace-fw {
  tar -xf "$*" -C /home/root/biosmart
  sync
  rm /home/root/biosmart.db
  restart
}

function prepare-fw {
  cd
  rm -rf fw
  rm fw.tar.gz
  mkdir fw
  tar -xf "$*" -C fw
  cp "$*" fw.tar.gz
  cd fw
}

function install-fw {
  prepare-fw "$*"
  /etc/init.d/biosmart stop
  ./install.sh --nofw
  /etc/init.d/biosmart start
  cd -
}

export -f replace-fw
export -f install-fw
export -f prepare-fw
