Split hello() into multiple functions
This commit is contained in:
parent
1de766e632
commit
4075a3e4cb
1 changed files with 21 additions and 5 deletions
|
@ -60,7 +60,7 @@ clitip() {
|
||||||
xmlstarlet unesc | fmt -80 | iconv -t US
|
xmlstarlet unesc | fmt -80 | iconv -t US
|
||||||
}
|
}
|
||||||
|
|
||||||
GIT_REPOS=(~/.password-store ~/SetupCockpit ~/Keepass ~/Lessons/* ~/PersonalScripts ~/RootMe ~/SRC/*)
|
GIT_REPOS=(~/.password-store ~/SetupCockpit ~/Keepass ~/TSSR ~/Lessons/* ~/PersonalScripts ~/RootMe ~/SRC/*)
|
||||||
|
|
||||||
cockpit() { # enable pass-like commands (ex: cockpit git push)
|
cockpit() { # enable pass-like commands (ex: cockpit git push)
|
||||||
local start_dir="$PWD"
|
local start_dir="$PWD"
|
||||||
|
@ -68,10 +68,7 @@ cockpit() { # enable pass-like commands (ex: cockpit git push)
|
||||||
cd "$start_dir" && echo 'done'
|
cd "$start_dir" && echo 'done'
|
||||||
}
|
}
|
||||||
|
|
||||||
hello() {
|
system_update() {
|
||||||
local start_dir="$PWD"
|
|
||||||
sudo protonvpn c -f
|
|
||||||
echo
|
|
||||||
# Don't update if its a kernel update that will require reboot
|
# Don't update if its a kernel update that will require reboot
|
||||||
if checkupdates >/dev/null 2>&1; then
|
if checkupdates >/dev/null 2>&1; then
|
||||||
case "$(checkupdates | grep linux && echo)" in
|
case "$(checkupdates | grep linux && echo)" in
|
||||||
|
@ -82,7 +79,10 @@ hello() {
|
||||||
sudo pacman -Syu
|
sudo pacman -Syu
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
pull_from_repos() {
|
||||||
|
local start_dir="$PWD"
|
||||||
for repo in "${GIT_REPOS[@]}"; do
|
for repo in "${GIT_REPOS[@]}"; do
|
||||||
echo "Pulling from $repo..."
|
echo "Pulling from $repo..."
|
||||||
cd "$repo" && git pull
|
cd "$repo" && git pull
|
||||||
|
@ -90,6 +90,22 @@ hello() {
|
||||||
cd "$start_dir" || exit 1
|
cd "$start_dir" || exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hello() {
|
||||||
|
sudo protonvpn c -f
|
||||||
|
system_update
|
||||||
|
|
||||||
|
echo -n "Do you want to pull from you git repos? [y/N] "
|
||||||
|
local answer
|
||||||
|
read -r answer
|
||||||
|
case "$answer" in
|
||||||
|
y)
|
||||||
|
pull_from_repos
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Not pulling from git repos."
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
bye() {
|
bye() {
|
||||||
cd || exit 1
|
cd || exit 1
|
||||||
git-summary -d
|
git-summary -d
|
||||||
|
|
Loading…
Add table
Reference in a new issue