From cc83b9eed4f663f5d619020b52eb7c955913834f Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Thu, 13 Nov 2008 19:27:48 +0000 Subject: [PATCH] (Change version) Added new distro maintainer flag: B_ALLOW_UPDATE='true' as default. If set to false, it will shut off the inxi script updating feature, and also turn off the display in -h of the -U option. This seems a lot easier than having to remove code each release, which would get fairly tiresome. --- inxi | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/inxi b/inxi index 57da309..f87912f 100755 --- a/inxi +++ b/inxi @@ -1,10 +1,10 @@ #!/bin/bash ######################################################################## #### Script Name: inxi -#### version: 0.5.24 -#### Date: November 11 2008 +#### version: 0.5.25 +#### Date: November 13 2008 ######################################################################## -#### inxi is a fork of infobash, the original bash sys info script by locsmif +#### inxi is a fork of infobash 3.02, the original bash sys info script by locsmif #### As time permits functionality improvements and recoding will occur. #### #### inxi, the universal, portable, system info script for irc. @@ -94,6 +94,9 @@ A_X_DATA='' # check to make sure initial steps run without error for debugging # inxi hasn't been 'booted' yet. B_ALL_UP='false' +# flag to allow distro maintainers to turn off update features. If false, turns off +# -U and -! testing/advanced update options, as well as removing the -U help menu item +B_ALLOW_UPDATE='true' # triggers full display of cpu flags B_CPU_FLAGS_FULL='false' # Debug flood override: make 'true' to allow long debug output @@ -502,13 +505,17 @@ get_cmdline() # args: $1 - full script startup args: $@ get_parameters() { - local opt='' wget_test='' + local opt='' wget_test='' update_flags='U!:' local use_short='true' # this is needed to trigger short output, every v/d/F/line trigger sets this false + if [[ $B_ALLOW_UPDATE == 'false' ]];then + update_flags='' + fi + # the short form only runs if no args output args are used # no need to run through these if there are no args if [[ -n $1 ]];then - while getopts Ac:CdDfFGhHINPSUv:Vx%@:!: opt + while getopts Ac:CdDfFGhHINPSv:Vx%@:${update_flags} opt do case $opt in A) B_SHOW_AUDIO='true' @@ -672,7 +679,9 @@ show_options() print_screen_output "-x Show extra data: bogomips on cpu. Only works with verbose or line output." print_screen_output "Additional Options:" print_screen_output "-h or -H - this help menu." - print_screen_output "-U Auto-update script. Note: if you installed as root, you" + if [[ $B_ALLOW_UPDATE == 'true' ]];then + print_screen_output "-U Auto-update script. Note: if you installed as root, you" + fi print_screen_output " must be root to update, otherwise user is fine." print_screen_output "-V $SCRIPT_NAME version information. Prints information then exits." print_screen_output "-% Overrides defective or corrupted data." @@ -693,8 +702,8 @@ print_version_info() print_screen_output "Tested with Irssi, Xchat, Konversation, BitchX, KSirc, ircII," print_screen_output "Gaim/Pidgin, Weechat, KVIrc and Kopete." print_screen_output "" - print_screen_output "This script is a fork of Infobash, which is:" - print_screen_output "Copyright (C) 2005-2007 Michiel de Boer a.k.a. locsmif " + print_screen_output "This script is a fork of Infobash 3.02, which is:" + print_screen_output "Copyright (C) 2005-2007 Michiel de Boer a.k.a. locsmif" print_screen_output "Subsequent changes and modifications (after Infobash 3.02) are:" print_screen_output "Copyright (C) 2008 Scott Rogers, Harald Hope, aka trash80 & h2" print_screen_output ""