From e6edbad14d8255743c7b259a1985db5fb5bd4e91 Mon Sep 17 00:00:00 2001 From: jjanzen Date: Wed, 5 Mar 2025 22:17:31 -0600 Subject: system changes --- macos.local/flake/home/scripts/manage-system.org | 47 ++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 macos.local/flake/home/scripts/manage-system.org (limited to 'macos.local/flake/home/scripts/manage-system.org') diff --git a/macos.local/flake/home/scripts/manage-system.org b/macos.local/flake/home/scripts/manage-system.org new file mode 100644 index 0000000..e8da0d9 --- /dev/null +++ b/macos.local/flake/home/scripts/manage-system.org @@ -0,0 +1,47 @@ +#+title: System Management Script + +#+begin_src sh + #!/bin/sh + + usage () + { + echo "Usage: $0 [command] where command is one of" + echo "help - show this message and exit" + echo "backup - push the configuration to the remote" + echo "update - update the system" + echo "install - install the system configurations" + } + + [ "$#" -eq 0 ] && usage && exit 1 + + dir="$pwd" + cd ~/.dotfiles || exit 1 + + case "$1" in + help) + usage + cd "$dir" || exit 1 + exit 0 + ;; + backup) + git push + cd "$dir" || exit 1 + exit 0 + ;; + update) + make update + cd "$dir" || exit 1 + exit 0 + ;; + install) + make install + cd "$dir" || exit 1 + exit 0 + ;; + ,*) + usage + cd "$dir" || exit 1 + exit 1 + ;; + esac +#+end_src -- cgit v1.2.3