diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/reconfigure | 18 |
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)" |