git.lirion.de

Of git, get, and gud

aboutsummaryrefslogtreecommitdiffstats
path: root/documentation/.update
diff options
context:
space:
mode:
authorH. P. <harald.p.@bechtle.com> 2019-11-25 10:04:43 +0100
committerH. P. <harald.p.@bechtle.com> 2019-11-25 10:04:43 +0100
commit737cf3c79a03489a53b250cf53cf2a8f53f603a4 (patch)
treef6bd73a2c3a78e3731c413d4ebd09fc47c477139 /documentation/.update
parent7bde242bc4d99505955f023b4a71aa08b3a762fd (diff)
downloadrhel-scripts-737cf3c79a03489a53b250cf53cf2a8f53f603a4.tar.bz2
+documentation scripts
Diffstat (limited to 'documentation/.update')
-rwxr-xr-xdocumentation/.update39
1 files changed, 39 insertions, 0 deletions
diff --git a/documentation/.update b/documentation/.update
new file mode 100755
index 0000000..2578735
--- /dev/null
+++ b/documentation/.update
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+RETVAL=0;WRONGOPT=0
+declare -x INVLIST
+
+function invhelp {
+ echo -e "USAGE:\t$(tput bold)$(basename "$0")$(tput sgr0) [OPTIONS...]"
+ echo
+ echo "Update the documentation automatically."
+ echo
+ (
+ echo "-a;all of the below options"
+ echo "-b;Update the block devices list"
+ echo "-d;Update the dnf history rawfile (in case of git repo:"
+ echo -e "\t; output is in .gitignore and needs to be parsed)"
+ echo "-h;This help"
+ echo "-g;Update the git inventory"
+ echo "-k;Update the KVM inventory"
+ )|column -ts\;
+}
+[ -z "$1" ]&&invhelp&&exit 0
+while getopts :abdgkh SHOPT;do
+ case $SHOPT in
+ a) INVLIST="block-inventory dnf-history kvm-inventory git-inventory";break 2;;
+ b) INVLIST+=" block-inventory";;
+ d) INVLIST+=" yum-history";;
+ k) INVLIST+=" kvm-inventory";;
+ g) INVLIST+=" git-inventory";;
+ h) invhelp&&exit 0||exit 1;;
+ *) echo "Not supported option: -""${OPTARG}" >&2;RETVAL=$(($RETVAL+1)) >&2;WRONGOPT=1;;
+ esac
+done
+RETVAL=$(($RETVAL+$?))
+shift $(( $OPTIND - 1 ))
+[ "$WRONGOPT" -eq 1 ]&&exit 1
+for i in $INVLIST;do
+ aux/"$i"
+done
+exit $RETVAL