From a19b8a7cf1360a0ee0f245d1938f60ff6f73a1f5 Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Fri, 15 Oct 2021 01:44:01 -0400 Subject: [PATCH] return of larch and an is_reboot_needed query larch is list_arch, in more accessible and funnily nostalgic form. i.e. number something or other, the larch. the larch. --- scripts/core/common.alias | 1 + scripts/system/is_reboot_needed.sh | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 scripts/system/is_reboot_needed.sh diff --git a/scripts/core/common.alias b/scripts/core/common.alias index 7dc95071..9c24dfc2 100644 --- a/scripts/core/common.alias +++ b/scripts/core/common.alias @@ -68,6 +68,7 @@ define_yeti_alias get_feisty='rpuffer $FEISTY_MEOW_APEX; regenerate' define_yeti_alias halt='sudo shutdown -h now' define_yeti_alias i=inventory define_yeti_alias l='perl $FEISTY_MEOW_SCRIPTS/files/summing_dir.pl' +define_yeti_alias larch='list_arch' define_yeti_alias ll='ls_dot_add=-a perl $FEISTY_MEOW_SCRIPTS/files/summing_dir.pl' define_yeti_alias ls='ls -HhFC $color_add' define_yeti_alias lsd='ls -hl' diff --git a/scripts/system/is_reboot_needed.sh b/scripts/system/is_reboot_needed.sh new file mode 100644 index 00000000..26d65a78 --- /dev/null +++ b/scripts/system/is_reboot_needed.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# returns an error value if reboot IS required due to some recent +# updates. otherwise returns a normal zero exit value indicating +# that things are peachy. + +if [ -f /var/run/reboot-required ]; then + echo 'reboot required' + exit 1 +fi +exit 0 + +#hmmm: add other OS versions, e.g. +# redhat/centos: $ needs-restarting -r ; echo $? +# shows if needs to be rebooted and returns an error if does need reboot +# -- 2.34.1