some updates to the bootstrap script btw
Signed-off-by: Andrei Jiroh Eugenio Halili <andreijiroh@madebythepins.tk>
This commit is contained in:
parent
2762303471
commit
4d94f3463d
20
bootstrap
20
bootstrap
|
@ -138,7 +138,7 @@ cleanup() {
|
||||||
rm -rfv ~/{shellcheck,flarectl,LICENSE,README.txt,README.md}
|
rm -rfv ~/{shellcheck,flarectl,LICENSE,README.txt,README.md}
|
||||||
pkg uninstall clang --yes && apt autoremove --yes
|
pkg uninstall clang --yes && apt autoremove --yes
|
||||||
else
|
else
|
||||||
rm -rfv ~/{shellcheck,flarectl,LICENSE,README.txt,README.md} || true
|
rm -rfv ~/{shellcheck,flarectl,LICENSE,README.txt,README.md}* || true
|
||||||
unset PREFIX
|
unset PREFIX
|
||||||
fi
|
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."
|
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"
|
cp "$HOME/.dotfiles/secrets/ssh/launchpad.pub" "~/.ssh/launchpad.pub"
|
||||||
chmod 600 "~/.ssh/launchpad"
|
chmod 600 "~/.ssh/launchpad"
|
||||||
else
|
else
|
||||||
[ ! -f " ~/.ssh/launchpad" ] && cp "$HOME/.dotfiles/secrets/ssh/launchpad" "~/.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" ] && "cp $HOME/.dotfiles/secrets/ssh/launchpad.pub" "~/.ssh/launchpad.pub"
|
||||||
chmod 600 "~/.ssh/launchpad"
|
[ -f "~/.ssh/launchpad.pub" ] && chmod 600 "~/.ssh/launchpad"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echoStageName "Linking config files"
|
echoStageName "Linking config files"
|
||||||
|
@ -217,24 +217,24 @@ installShellCheck() {
|
||||||
current_path_dir=$(dirname $current_shellcheck_path)
|
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"
|
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
|
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
|
elif [[ $current_shellcheck_path == "$PREFIX/bin/shellcheck" ]]; then
|
||||||
warn "Current ShellCheck install found in $PREFIX/bin, replacing with latest stable release..."
|
warn "Current ShellCheck install found in $PREFIX/bin, replacing with latest stable release..."
|
||||||
if [[ $isOwnedByUser == "" ]]; then
|
if [[ $isOwnedByUser == "" ]]; then
|
||||||
warn "Owned by either other user/root, summoning root"
|
[ -f "$PREFIX/bin/shellcheck" ] && warn "Owned by either other user/root, summoning root" && sudo rm "${PREFIX}/bin/shellcheck"
|
||||||
sudo rm "${PREFIX}/bin/shellcheck"
|
|
||||||
else
|
else
|
||||||
rm "${PREFIX}/bin/shellcheck"
|
rm "${PREFIX}/bin/shellcheck"
|
||||||
fi
|
fi
|
||||||
cp "shellcheck-${scversion}/shellcheck" "$PREFIX/bin"
|
cp "$HOME/shellcheck-${scversion}/shellcheck" "$PREFIX/bin"
|
||||||
else
|
else
|
||||||
warn "Current ShellCheck install found in $current_path_dir, will be removed..."
|
warn "Current ShellCheck install found in $current_path_dir, will be removed..."
|
||||||
if [[ $isOwnedByUser == "" ]]; then
|
if [[ $isOwnedByUser == "" ]]; then
|
||||||
sudo rm "${PREFIX}/bin/shellcheck"
|
warn "Owned by either other user/root, summoning root"
|
||||||
|
sudo rm "$current_path_dir/shellcheck"
|
||||||
else
|
else
|
||||||
rm "${PREFIX}/bin/shellcheck"
|
rm "${PREFIX}/bin/shellcheck"
|
||||||
fi
|
fi
|
||||||
cp "shellcheck-${scversion}/shellcheck" "$PREFIX/bin"
|
cp "$HOME/shellcheck-${scversion}/shellcheck" "$PREFIX/bin"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue