aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2023-03-12 09:27:09 -0300
committerEuAndreh <eu@euandre.org>2023-03-12 09:27:14 -0300
commitc7296f70bc3c95053fb4078b61a052c51dda8762 (patch)
treea05e88e2648fea54dd258338a5bff654b6bba98c /bin
parentetc/guix/home.scm: Inline definition of clipmenu-latest from org-euandre channel (diff)
downloaddotfiles-c7296f70bc3c95053fb4078b61a052c51dda8762.tar.gz
dotfiles-c7296f70bc3c95053fb4078b61a052c51dda8762.tar.xz
bin/reconfigure: Add -U option to call update(1)
Adapt the cronjob to use it also.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/reconfigure18
1 files changed, 16 insertions, 2 deletions
diff --git a/bin/reconfigure b/bin/reconfigure
index af94f48..72eb0c7 100755
--- a/bin/reconfigure
+++ b/bin/reconfigure
@@ -4,7 +4,7 @@ set -eu
usage() {
cat <<-'EOF'
Usage:
- reconfigure
+ reconfigure [-U]
reconfigure -h
EOF
}
@@ -13,6 +13,7 @@ help() {
cat <<-'EOF'
Options:
+ -U run update(1) before acting
-h, --help show this message
@@ -27,6 +28,11 @@ help() {
Just use it:
$ reconfigure
+
+
+ Update before reconfiguring:
+
+ $ reconfigure -U
EOF
}
@@ -46,8 +52,12 @@ for flag in "$@"; do
esac
done
-while getopts 'h' flag; do
+UPDATE=false
+while getopts 'Uh' flag; do
case "$flag" in
+ U)
+ UPDATE=true
+ ;;
h)
usage
help
@@ -68,6 +78,10 @@ if [ "$(id -un)" = 'root' ]; then
exit 2
fi
+if [ "$UPDATE" = true ]; then
+ update
+fi
+
HOSTNAME="$(hostname)"