#!/bin/bash
# - bof - #



<<'comment'

# - Configured - #

rm -rf ~/.bashrc;
vim ~/.bashrc;

rm -rf ~/.zshrc;
vim ~/.zshrc;

ssh-keygen -R 192.168.1.1

# - On client - #
cd ~/.ssh;
ssh-keygen -t rsa;

cat ~/.ssh/id_rsa.pub;

# - On server - #
vim ~/.ssh/authorized_keys;

xdg-user-dirs-update;
sudo apt install curl dialog duf figlet git gparted lolcat neovim pv webapp-manager -y;
sudo apt install curl dialog duf figlet git gparted htop inxi lolcat net-tools neovim pv webapp-manager -y;



# -  - #
# - Timezone - #
sudo timedatectl set-ntp true;
sudo timedatectl set-timezone America/New_York;
timedatectl status;
timedatectl;



bash <(curl -s https://www.education.isdevelopment.us/Arch.Ins/Software.Ins/BalenaEtcherConfig.sh)



curl -sL "https://education.isdevelopment.us/Arch.Ins/Software.Ins/BalenaEtcher.tar.bz2" \
  | tar -xjO BalenaEtcherConfig.sh \
  | bash



cd ~/; rm -rf ~/bEtcher.sh; vim ~/bEtcher.sh;
Copy & paste this content
chmod +x ~/bEtcher.sh; ~/./bEtcher.sh;

comment



# -  - #
# - additionalSoftware_ - #
function additionalSoftware_(){
  sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y && sudo apt clean;
  sudo apt install libfuse2t64 ffmpeg -y;
}



# -  - #
# - variablesDefinition_ - #
function variablesDefinition_(){
  sU_=$USER;
  sDwn_=~/Downloads/
  oD_=$sDwn_'BalenaEtcher.Ins/';
  dD_=/home/$sU_/.AppImages/BalenaEtcher/;
  sLs_=/home/$sU_/.local/share/;
  dSa_=$sLs_'applications/';
  dCf_=$dSa_'BalenaEtcher.desktop';
  eF_=balenaEtcher-1.18.4-x64.AppImage;
 #eF_=balenaEtcher-1.19.25-x64.AppImage;
  iF_=BalenaEtcher1.png;
}



# -  - #
# - downloadBalenaEtcher_ - #
function downloadBalenaEtcher_(){
  echo -e "\n\n\nDownloading BalenaEtcher files ...\n"
  mkdir -p $sDwn_ && \
  curl -sL "https://www.education.isdevelopment.us/Arch.Ins/Software.Ins/BalenaEtcher.tar.bz2" \
  | tar -xj -C $sDwn_
}



# -  - #
# - copyingBalenaEtcherFiles_ - #
function copyingBalenaEtcherFiles_(){
  echo -e "\n\n\nCopying BalenaEtcher files ...\n"
  mkdir -p $dSa_ $dD_;
  mv -vf $oD_$eF_ $dD_;
  mv -vf $oD_$iF_ $dD_;
}



# -  - #
# - createDesktopConfigurationFile_ - #
function createDesktopConfigurationFile_(){
  local eFnoSb_=$eF_' --no-sandbox';
rm -rf $dCf_;
cat <<EOF >> $dCf_;
[Desktop Entry]
Type=Application
Name=BalenaEtcher
Comment=Burn ISO file into a USB stick
Exec=$dD_$eFnoSb_
Icon=$dD_$iF_
Terminal=false
StartupWMClass=BalenaEtcher
Categories=System;
StartupNotify=false
EOF
}



# -  - #
# - cleaningUp_ - #
function cleaningUp_(){
  local dFiles_=$sDwn_'BalenaEtcher*';
  # -  - #
  # - Cleaning up ~/Downloads folder - #
  rm -rf $dFiles_ ~/bEtcher.sh;
}



clear;

additionalSoftware_;
variablesDefinition_;
downloadBalenaEtcher_;
copyingBalenaEtcherFiles_;
createDesktopConfigurationFile_;
cleaningUp_;

echo -e  "\n\n\nBalenaEtcher was installed & configured successfully...\n\n";



<<'comment'
cd ~/; rm -rf ~/bEtcher.sh; vim ~/bEtcher.sh;
Copy & paste this content
chmod +x ~/bEtcher.sh; ~/./bEtcher.sh;
comment

# - eof - #