bash_aliases/topgrade.aliases
deathbybandaid ce048f4eb7 test
2022-03-08 10:18:31 -05:00

44 lines
1.1 KiB
Plaintext

# Run Topgrade without parameters, equivalent of being installed to PATH
topgrade_path="/opt/topgrade/topgrade"
topgrade_conf_path="/etc/topgrade"
topgrade_conf_repo="https://git.deathbybandaid.net/deathbybandaid/topgrade.git"
# Use Configuration options from repo
topgrade_conf_pull ()
{
if [[ -d "$topgrade_conf_path" ]] ; then
git -C $topgrade_conf_path pull --quiet && echo "Pulled $topgrade_conf_path"
else
git clone --quiet "$topgrade_conf_repo" "$topgrade_conf_path" && echo "Pulled $topgrade_conf_path"
fi
}
alias topgrade-conf-pull='topgrade_conf_pull'
#alias topgrade='$topgrade_path'
# System Updates Only
alias sysup='$topgrade_path --config $topgrade_conf_path/systemonly.toml'
# Template Repos
alias templategitup='$topgrade_path --config $topgrade_conf_path/template_git.toml'
topgrade ()
{
if [[ -f "$topgrade_path" ]] ; then
$topgrade_path
else
echo "topgrade not found at $topgrade_path"
fi
}
# System Updates Only
#sysup ()
#{
# if [[ -f "$topgrade_path" ]] ; then
# $topgrade_path --config $topgrade_conf_path/systemonly.toml
# else
# echo "topgrade not found at $topgrade_path"
# fi
#}