#!/bin/bash ############################## # BIZBASH ############################## # SETUP ========== # source <(curl -L biznet.biznach.com) # biznet # INITIALIZATION ========== currentdir=$PWD if [[ ! ( -s $HOME/biznet ) ]]; then git clone https://github.com/biznach/biznet if [[ -s $HOME/biznet ]]; then cd $HOME/biznet bizgit biznet cd $currentdir fi fi if [[ -s $HOME/.bashrc ]]; then if grep -Fq "BIZNET" $HOME/.bashrc; then echo "BizNet Initialized" > /dev/null else if [[ -s $HOME/biznet/bizbashinc ]]; then echo "BizNet Initializing" > /dev/null cat $HOME/biznet/bizbashinc >> $HOME/.bashrc else echo "Biz Include Not Found!" > /dev/null fi fi else echo"Initialization Failed!" > /dev/null fi # BIZPATH ========== export PATH=$HOME/biznet:$PATH # ALIASES ========== # some more ls aliases alias l1='ls -1' alias lla='ls -la' alias ll='ls -a' alias ll='ls -l' alias read='less ./README.txt' # VARIABLES ========== RED='\033[0;31m' GREEN='\033[0;32m' CYAN='\033[1;36m' NC='\033[0m' # No Color # variable for friendly host name if [[ -s $HOME/.bizconfig ]]; then # export first line of .bizconfig file as env variable export BIZHOST=$( awk '{print $1; exit}' $HOME/.bizconfig ) else export BIZHOST="biznet" fi # save history after every command #export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND" export PROMPT_COMMAND="history -a; history -c; history -r" # BIZPROMT ========== case "$TERM" in xterm-color|*-256color) color_prompt=yes;; esac if [ "$color_prompt" = yes ]; then PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@$BIZHOST\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' else PS1='${debian_chroot:+($debian_chroot)}\u@$BIZHOST:\w\$ ' fi unset color_prompt # SSH LAUNCHER ========== # Using souced script to setup SSH if [[ -s $HOME/biznet/bizkey ]]; then source bizkey &> /dev/null fi # BIZBOT DIALOGFLOW ========== # export GOOGLE_APPLICATION_CREDENTIALS="/home/bitnami/.ssh/bizbot.json" # WELCOME ========== if [[ ! -z $( command -v figlet ) ]]; then figlet ' BizNet' else echo -e '\n BizNet BizNet BizNet BizNet' fi echo -e " *** ${CYAN}Welcome to BizNet${NC} ***\n" # INCLUDES ========== # homebrew if [[ ( -s /home/linuxbrew/.linuxbrew/bin/brew ) ]]; then eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv) fi if [[ ! -s $HOME/.bizconfig ]]; then echo -e "Enter ${CYAN}biznet${NC} for Configuration\n" fi