some updates to the bootstrap script btw

Signed-off-by: Andrei Jiroh Eugenio Halili <andreijiroh@madebythepins.tk>
This commit is contained in:
Andrei Jiroh Eugenio Halili 2021-08-10 14:05:04 +00:00
parent 2762303471
commit 4d94f3463d
Signed by: ajhalili2006
GPG Key ID: A30EBE40AD856D88
1 changed files with 10 additions and 10 deletions

View File

@ -138,7 +138,7 @@ cleanup() {
rm -rfv ~/{shellcheck,flarectl,LICENSE,README.txt,README.md}
pkg uninstall clang --yes && apt autoremove --yes
else
rm -rfv ~/{shellcheck,flarectl,LICENSE,README.txt,README.md} || true
rm -rfv ~/{shellcheck,flarectl,LICENSE,README.txt,README.md}* || true
unset PREFIX
fi
success "Setting up a new Linux machine was succesfully executed. To ensure no secrets are leaked when logging utfrom shell session, please do 'history -c' to cleanup shell history."
@ -156,9 +156,9 @@ copyKeysSSH() {
cp "$HOME/.dotfiles/secrets/ssh/launchpad.pub" "~/.ssh/launchpad.pub"
chmod 600 "~/.ssh/launchpad"
else
[ ! -f " ~/.ssh/launchpad" ] && cp "$HOME/.dotfiles/secrets/ssh/launchpad" "~/.ssh/launchpad"
[ ! -f " ~/.ssh/launchpad.pub" ] && "cp $HOME/.dotfiles/secrets/ssh/launchpad.pub" "~/.ssh/launchpad.pub"
chmod 600 "~/.ssh/launchpad"
[ ! -f "~/.ssh/launchpad" ] && cp "$HOME/.dotfiles/secrets/ssh/launchpad" "~/.ssh/launchpad"
[ ! -f "~/.ssh/launchpad.pub" ] && "cp $HOME/.dotfiles/secrets/ssh/launchpad.pub" "~/.ssh/launchpad.pub"
[ -f "~/.ssh/launchpad.pub" ] && chmod 600 "~/.ssh/launchpad"
fi
echoStageName "Linking config files"
@ -217,24 +217,24 @@ installShellCheck() {
current_path_dir=$(dirname $current_shellcheck_path)
wget -qO- "https://github.com/koalaman/shellcheck/releases/download/${scversion?}/shellcheck-${scversion?}.linux.x86_64.tar.xz" | tar -xJv -C "$HOME"
if [[ $current_shellcheck_path == "" ]]; then
cp "shellcheck-${scversion}/shellcheck" "$PREFIX/bin"
cp "$HOME/shellcheck-${scversion}/shellcheck" "$PREFIX/bin"
elif [[ $current_shellcheck_path == "$PREFIX/bin/shellcheck" ]]; then
warn "Current ShellCheck install found in $PREFIX/bin, replacing with latest stable release..."
if [[ $isOwnedByUser == "" ]]; then
warn "Owned by either other user/root, summoning root"
sudo rm "${PREFIX}/bin/shellcheck"
[ -f "$PREFIX/bin/shellcheck" ] && warn "Owned by either other user/root, summoning root" && sudo rm "${PREFIX}/bin/shellcheck"
else
rm "${PREFIX}/bin/shellcheck"
fi
cp "shellcheck-${scversion}/shellcheck" "$PREFIX/bin"
cp "$HOME/shellcheck-${scversion}/shellcheck" "$PREFIX/bin"
else
warn "Current ShellCheck install found in $current_path_dir, will be removed..."
if [[ $isOwnedByUser == "" ]]; then
sudo rm "${PREFIX}/bin/shellcheck"
warn "Owned by either other user/root, summoning root"
sudo rm "$current_path_dir/shellcheck"
else
rm "${PREFIX}/bin/shellcheck"
fi
cp "shellcheck-${scversion}/shellcheck" "$PREFIX/bin"
cp "$HOME/shellcheck-${scversion}/shellcheck" "$PREFIX/bin"
fi
fi
}