diff --git a/installs/debian/adar.sh b/installs/debian/adar.sh index 560a9ca..3bb185e 100755 --- a/installs/debian/adar.sh +++ b/installs/debian/adar.sh @@ -5,6 +5,7 @@ # i.e. Basic install, Server, Desktop nogui, Desktop gui, INSTALL_TYPE="" +USER="nathan" # If the user isn't root. Don't run. if [[ $EUID -ne 0 ]]; then @@ -22,21 +23,28 @@ fi # Download the scripts apt install git -if [ -d "~/adarDir" ] +if [ -d "/home/$USER/adarDir" ] then echo "Directory already exists, skipping git clone" else - echo "Directory doesn't exists" - git clone ssh://git@alphavps.aney.co.uk:2020/srv/git/scripts.git ~/adarDir + echo "Directory doesn't exist" + git clone ssh://git@alphavps.aney.co.uk:2020/srv/git/scripts.git /home/$USER/adarDir fi # Enter the directory -cd ~/adarDir/installs/debian +cd /home/$USER/adarDir/installs/debian if [ "$INSTALL_TYPE" == "server" ] then - bash debian_server.sh + bash debian_server.sh $USER else - bash debian_desktop.sh + bash debian_desktop.sh $USER + echo -e "\nDo you wish to install a GUI?\n1)Yes\nOther)No" + read INPUT + if [ $INPUT -eq 1 ] + then + bash debian_gui.sh + bash debian_unfinished.sh + fi fi diff --git a/installs/debian/debian_base.sh b/installs/debian/debian_base.sh index aacb1a4..455be93 100755 --- a/installs/debian/debian_base.sh +++ b/installs/debian/debian_base.sh @@ -16,7 +16,7 @@ adduser nathan sudo # System Utilities apt install perl wget curl man -y -# Make the terminal usable* +# Make the terminal usable apt install tmux -y ## Text Editors @@ -26,7 +26,7 @@ apt install vim -y apt install git -y # Compression Utilities -apt install gzip zip tar bzip2 urar -y +apt install gzip zip tar bzip2 unrar-free -y # Install terminal system utilities apt install htop -y @@ -34,18 +34,6 @@ apt install htop -y # Backups apt install rsync rdiff-backup -y -HOME=/home/nathan/ -# lf file manager -sudo -H -u nathan bash -c "mkdir $HOME/.local $HOME/.local/bin" -sudo -H -u nathan bash -c "curl -LO https://github.com/gokcehan/lf/releases/latest/download/lf-linux-amd64.tar.gz | tar -xf -C $HOME/.local/bin" - -# Vi mode terminal and local bin -echo "set -o vi\nexport PATH=\$HOME/.local/bin:\$PATH" >> .zshrc -echo "export PATH=\$HOME/.local/bin/*:\$PATH" >> .zshrc -# Add to path for this session -export PATH=\$HOME/.local/bin/:$PATH -export PATH=\$HOME/.local/bin/dmenu:$PATH - # Firewall apt install ufw -y systemctl --now enable ufw diff --git a/installs/debian/debian_desktop.sh b/installs/debian/debian_desktop.sh index a1dff56..15f33aa 100755 --- a/installs/debian/debian_desktop.sh +++ b/installs/debian/debian_desktop.sh @@ -2,8 +2,17 @@ # It is assumed that it's a minimal install, with at least debian_base # This will install additional utilities that make debain usable without a GUI -# Download and install debian_base? -bash ~/adarDir/debian_base.sh +if [ $# -eq 0 ] && [ -z "$1" ] +then + echo "No username passed to desktop script" + exit 1 +fi + +# Install debian_base (adar) +if [ -f "debian_base.sh"] +then + bash debian_base.sh +fi # Better text editing IDE-esk apt install neovim -y @@ -23,7 +32,7 @@ apt install network-manager -y apt install blueman -y # Music Player (daemon, and utilities) -apt install mpd mpc mcmpcpp -y +apt install mpd mpc ncmpcpp -y # RSS Reader apt install newsboat -y @@ -38,20 +47,36 @@ apt install groff -y apt install zsh -y # Change default shell to zsh -chsh nathan -s /bin/zsh +chsh $1 -s /bin/zsh # Oh my Zsh -sudo -H -u nathan bash -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended +if [ ! -d "/home/$1/.oh-my-zsh" ] +then + sudo -H -u $1 bash -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended +fi -exit 0 +HOME=/home/$1 + +# lf file manager +sudo -H -u nathan bash -c "mkdir -p $HOME/.local/bin" +sudo -H -u nathan bash -c "curl -LO https://github.com/gokcehan/lf/releases/latest/download/lf-linux-amd64.tar.gz | tar -xf lf-linux-amd64.tar.gz -C $HOME/.local/bin" + +# Vi mode terminal and local bin +echo "set -o vi\nexport PATH=\$HOME/.local/bin:\$PATH" >> /home/$1/.bashrc +echo "export PATH=\$HOME/.local/bin/*:\$PATH" >> /home/$1/.bashrc +# Add to path for this session +export PATH=\$HOME/.local/bin/:$PATH +export PATH=\$HOME/.local/bin/dmenu:$PATH # Download Utilities (Legallity, uncertain) ## Youtube-dl curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl chmod a+rx /usr/local/bin/youtube-dl +exit 0 + ## Torrenting (Seperate script?) -apt install transmission-daemon transmission-cli transmission-remote-cli -y +#apt install transmission-daemon transmission-cli transmission-remote-cli -y #systemctl stop transmission-daemon.service #/lib/systemd/system/tranmission-daemon.service # Change debian-transmission to $USER # systemctl daemon-reload