mirror of
https://github.com/smxi/inxi.git
synced 2024-11-16 16:21:39 +00:00
inxi -U will now install the man file too, but only if /usr/share/man/man8 directory exists.
And if user is logged in as root. The -U procedure for inxi itself will run independently of that. On completion of inxi download/update, if successful, will do the man page update/install. And that's that.
This commit is contained in:
parent
88217d7c74
commit
e9c2c3882a
38
inxi
38
inxi
|
@ -1,8 +1,8 @@
|
|||
#!/bin/bash
|
||||
########################################################################
|
||||
#### Script Name: inxi
|
||||
#### version: 1.8.9
|
||||
#### Date: June 24 2012
|
||||
#### version: 1.8.10
|
||||
#### Date: June 25 2012
|
||||
#### Patch Number: 00
|
||||
########################################################################
|
||||
#### SPECIAL THANKS
|
||||
|
@ -414,6 +414,7 @@ ALTERNATE_FTP='' # for data uploads
|
|||
LOG_FILE="$SCRIPT_DATA_DIR/inxi.log"
|
||||
LOG_FILE_1="$SCRIPT_DATA_DIR/inxi.1.log"
|
||||
LOG_FILE_2="$SCRIPT_DATA_DIR/inxi.2.log"
|
||||
MAN_FILE_DOWNLOAD='http://inxi.googlecode.com/svn/trunk/inxi.8.gz'
|
||||
SCRIPT_NAME="inxi"
|
||||
SCRIPT_PATCH_NUMBER=''
|
||||
SCRIPT_PATH="" #filled-in in Main
|
||||
|
@ -1250,7 +1251,8 @@ create_rotate_logfiles()
|
|||
script_self_updater()
|
||||
{
|
||||
eval $LOGFS
|
||||
local wget_error=0 file_contents=''
|
||||
local wget_error=0 file_contents='' wget_man_error=0
|
||||
local man_location='/usr/share/man/man8'
|
||||
print_screen_output "Starting $SCRIPT_NAME self updater."
|
||||
print_screen_output "Currently running $SCRIPT_NAME version number: $SCRIPT_VERSION_NUMBER"
|
||||
print_screen_output "Current version patch number: $SCRIPT_PATCH_NUMBER"
|
||||
|
@ -1268,6 +1270,32 @@ script_self_updater()
|
|||
print_screen_output "Successfully updated to $2 version: $SCRIPT_VERSION_NUMBER"
|
||||
print_screen_output "New $2 version patch number: $SCRIPT_PATCH_NUMBER"
|
||||
print_screen_output "To run the new version, just start $SCRIPT_NAME again."
|
||||
print_screen_output "----------------------------------------"
|
||||
print_screen_output "Starting download of man page file now."
|
||||
if [[ ! -d $man_location ]];then
|
||||
print_screen_output "The required man directory was not detected on your system, unable to continue: $man_location"
|
||||
else
|
||||
if [[ $B_ROOT == 'true' ]];then
|
||||
print_screen_output "Checking Man page download URL..."
|
||||
wget -q --spider $MAN_FILE_DOWNLOAD || wget_man_error=$?
|
||||
if [[ $wget_man_error -eq 0 ]];then
|
||||
print_screen_output "Man file download URL verified: $MAN_FILE_DOWNLOAD"
|
||||
print_screen_output "Downloading Man page file now."
|
||||
wget -O $man_location $MAN_FILE_DOWNLOAD || wget_man_error=$?
|
||||
if [[ $wget_man_error -gt 0 ]];then
|
||||
print_screen_output "Oh no! Something went wrong downloading the Man gz file at: $MAN_FILE_DOWNLOAD"
|
||||
print_screen_output "Check the error messages for what happened."
|
||||
else
|
||||
print_screen_output " Download/install of man page successful. Check to make sure it works: man inxi"
|
||||
fi
|
||||
else
|
||||
print_screen_output "Man file download URL failed, unable to continue: $MAN_FILE_DOWNLOAD"
|
||||
fi
|
||||
else
|
||||
print_screen_output "Updating / Installing the Man page requires root user, writing to: $man_location"
|
||||
print_screen_output "If you want the man page, you'll have to run $SCRIPT_NAME -U as root."
|
||||
fi
|
||||
fi
|
||||
exit 0
|
||||
else
|
||||
error_handler 16
|
||||
|
@ -2249,8 +2277,8 @@ show_options()
|
|||
print_screen_output "--recommends Checks $SCRIPT_NAME application dependencies + recommends, and directories, then shows"
|
||||
print_screen_output " what package(s) you need to install to add support for that feature."
|
||||
if [[ $B_ALLOW_UPDATE == 'true' ]];then
|
||||
print_screen_output "-U Auto-update script. Note: if you installed as root, you"
|
||||
print_screen_output " must be root to update, otherwise user is fine."
|
||||
print_screen_output "-U Auto-update script. Will also install/update man page. Note: if you installed as root, you"
|
||||
print_screen_output " must be root to update, otherwise user is fine. Man page installs require root user mode."
|
||||
fi
|
||||
print_screen_output "-V --version $SCRIPT_NAME version information. Prints information then exits."
|
||||
print_screen_output " "
|
||||
|
|
Loading…
Reference in a new issue