Now we can select a step from the installation process

This commit is contained in:
Gerardo J. Puerta 2022-09-07 19:47:46 -05:00
parent 01c6c74357
commit 5b2975510f
4 changed files with 183 additions and 108 deletions

View File

@ -1,7 +1,8 @@
#!/bin/bash #!/bin/bash
packages="sshpass tmux python3-pip cargo vim-nox build-essential python3-dev \ packages="sshpass tmux python3-pip cargo vim-nox build-essential python3-dev \
zathura zathura-pdf-poppler" gcc-9 g++-9 python2 python2-dev guestfish libncurses-dev"
pip="awscli cmake" pip="awscli cmake"
read -p "Are you sure? (Y/N) " read -p "Are you sure? (Y/N) "
@ -18,71 +19,87 @@ mkdir -p ~/.config
release=$(lsb_release -d | grep -i ubuntu > /dev/null && echo ubuntu || echo unknown) release=$(lsb_release -d | grep -i ubuntu > /dev/null && echo ubuntu || echo unknown)
echo "Release is $release" echo "Release is $release"
if [[ "$release" == "ubuntu" ]] install_packages() {
then if [[ "$release" == "ubuntu" ]]
then
echo "Installing packages ..." echo "Installing packages ..."
sudo apt install -y $packages sudo apt install -y $packages
fi echo "Updating alternatives ..."
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 9
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 9
fi
}
if [[ -f /usr/bin/pip3 ]] install_pip() {
then if [[ -f /usr/bin/pip3 ]]
then
echo "Pip 3 detected, installing packages ..." echo "Pip 3 detected, installing packages ..."
pip install --user -U $pip pip install --user -U $pip
fi fi
if [[ -f ~/.dotfiles/inputrc ]] if [[ -f ~/.dotfiles/inputrc ]]
then then
echo "Installing inputrc ..." echo "Installing inputrc ..."
rm -rf ~/.inputrc rm -rf ~/.inputrc
ln -sf ~/.dotfiles/inputrc ~/.inputrc ln -sf ~/.dotfiles/inputrc ~/.inputrc
fi fi
if [[ -f ~/.dotfiles/bash/bashrc ]] if [[ -f ~/.dotfiles/bash/bashrc ]]
then then
echo "Dotfiles bashrc found, linking it ..." echo "Dotfiles bashrc found, linking it ..."
rm -rf ~/.bashrc rm -rf ~/.bashrc
ln -sf ~/.dotfiles/bash/bashrc ~/.bashrc ln -sf ~/.dotfiles/bash/bashrc ~/.bashrc
fi fi
if [[ -f ~/.dotfiles/tmux/tmux.conf ]] if [[ -f ~/.dotfiles/tmux/tmux.conf ]]
then then
echo "Dotfiles tmux.conf found, linking it ..." echo "Dotfiles tmux.conf found, linking it ..."
rm -rf ~/.tmux.conf rm -rf ~/.tmux.conf
ln -sf ~/.dotfiles/tmux/tmux.conf ~/.tmux.conf ln -sf ~/.dotfiles/tmux/tmux.conf ~/.tmux.conf
rm -rf ~/.tmux rm -rf ~/.tmux
ln -sf ~/.dotfiles/tmux ~/.tmux ln -sf ~/.dotfiles/tmux ~/.tmux
fi fi
}
# I hate this but no other option worked ... install_starship() {
if [[ ! -f /usr/local/bin/starship ]] # I hate this but no other option worked ...
then if [[ ! -f /usr/local/bin/starship ]]
then
echo "Installing starship ..." echo "Installing starship ..."
curl -sS https://starship.rs/install.sh | sh curl -sS https://starship.rs/install.sh | sh
fi fi
}
if [[ -f ~/.dotfiles/starship/starship.toml ]] setup_starship() {
then if [[ -f ~/.dotfiles/starship/starship.toml ]]
then
echo "Installing starship configuration ..." echo "Installing starship configuration ..."
rm -rf ~/.config/starship.toml rm -rf ~/.config/starship.toml
ln -sf ~/.dotfiles/starship/starship.toml ~/.config/starship.toml ln -sf ~/.dotfiles/starship/starship.toml ~/.config/starship.toml
fi fi
}
if [[ -f ~/.dotfiles/git/gitconfig ]] setup_git() {
then if [[ -f ~/.dotfiles/git/gitconfig ]]
then
echo "Installing git configuration ..." echo "Installing git configuration ..."
rm -rf ~/.gitconfig rm -rf ~/.gitconfig
ln -sf ~/.dotfiles/git/gitconfig ~/.gitconfig ln -sf ~/.dotfiles/git/gitconfig ~/.gitconfig
fi fi
}
if [[ -d ~/.dotfiles/ssh ]] setup_ssh() {
then if [[ -d ~/.dotfiles/ssh ]]
then
echo "Installing ssh configuration ..." echo "Installing ssh configuration ..."
rm -rf ~/.ssh rm -rf ~/.ssh
ln -sf ~/.dotfiles/ssh ~/.ssh ln -sf ~/.dotfiles/ssh ~/.ssh
fi fi
}
if [[ -d ~/.dotfiles/vim ]] setup_vim() {
then if [[ -d ~/.dotfiles/vim ]]
then
echo "Installing vim configuration ..." echo "Installing vim configuration ..."
rm -rf ~/.vimrc rm -rf ~/.vimrc
mkdir -p ~/.vim/bundle mkdir -p ~/.vim/bundle
@ -94,16 +111,20 @@ then
ln -sf ~/.dotfiles/vim/vimrc ~/.vimrc ln -sf ~/.dotfiles/vim/vimrc ~/.vimrc
echo "Installing vim plugins ..." echo "Installing vim plugins ..."
vim +'PlugInstall --sync' +qa vim +'PlugInstall --sync' +qa
fi fi
}
if [[ -d ~/.vim/bundle/YouCompleteMe ]] install_ycm() {
then if [[ -d ~/.vim/bundle/YouCompleteMe ]]
then
echo "Installing ycm dependencies" echo "Installing ycm dependencies"
python3 ~/.vim/bundle/YouCompleteMe/install.py python3 ~/.vim/bundle/YouCompleteMe/install.py
fi fi
}
if [[ -d ~/.dotfiles/projects ]] install_projects() {
then if [[ -d ~/.dotfiles/projects ]]
then
for f in ~/.dotfiles/projects/* for f in ~/.dotfiles/projects/*
do do
if [[ -f $f/basegit ]] if [[ -f $f/basegit ]]
@ -122,6 +143,23 @@ then
done < $f/projects done < $f/projects
fi fi
done done
fi
}
if [[ $1 != "" ]]
then
$1
else
install_packages
install_pip
install_starship
setup_starship
setup_ssh
setup_git
setup_vim
install_ycm
install_projects
fi fi
. ~/.bashrc . ~/.bashrc

View File

@ -0,0 +1 @@
https://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@github.com/enoc-link/

View File

@ -0,0 +1,36 @@
akstest
app
argocd
obdapp
cell-locator
cvs
dnscontrol
healthdata
healthstatus
infrastructure
livecontrol
logforwarder
logs
loki
modemcontrol
mqtt
mqtt-exporter
odoo
opkg-repository
osconfigurator
print
prometheus
queuecontrol
queuecontrol_test
registergateway
releasecontrol
rfidgateway
titr
truck-hub
truckhubapi
truckhubinit
truckhubupdate
truckos
usercontrol
vpn-dns
wificontrol

View File

@ -53,12 +53,12 @@ let g:SimpylFold_docstring_preview=1
" PEP8 indentation " PEP8 indentation
au BufNewFile,BufRead *.py au BufNewFile,BufRead *.py
\ set tabstop=4 \ set tabstop=4 |
\ set softtabstop=4 \ set softtabstop=4 |
\ set shiftwidth=4 \ set shiftwidth=4 |
\ set textwidth=79 \ set textwidth=79 |
\ set expandtab \ set expandtab |
\ set autoindent \ set autoindent |
\ set fileformat=unix \ set fileformat=unix
" Delete trailing whitespaces on save " Delete trailing whitespaces on save