mirror of
https://github.com/smxi/inxi.git
synced 2025-01-19 00:47:47 +00:00
Adding version number output for updating feature
This commit is contained in:
parent
c63f96f40e
commit
ae63e9973b
5
inxi
5
inxi
|
@ -408,10 +408,11 @@ get_parameters()
|
|||
grep -q "^[0-${VERBOSITY_LEVELS}]$" <<< $VERBOSITY_LEVEL || error_handler 4 "$VERBOSITY_LEVEL"
|
||||
;;
|
||||
-U)
|
||||
print_screen_output "Updating $SCRIPT_NAME now..."
|
||||
print_screen_output "Updating $SCRIPT_NAME. Current version number: $SCRIPT_VERSION_NUMBER"
|
||||
wget -O $SCRIPT_PATH/$SCRIPT_NAME http://techpatterns.com/downloads/distro/$SCRIPT_NAME || error_handler 8 "$?"
|
||||
if [ "$?" -eq 0 ];then
|
||||
print_screen_output "To run the new version, just start $SCRIPT_NAME again."
|
||||
SCRIPT_VERSION_NUMBER=$( grep -im 1 'version:' $SCRIPT_PATH/$SCRIPT_NAME | awk '{print $3}' )
|
||||
print_screen_output "Successfully updated to version: $SCRIPT_VERSION_NUMBER\nTo run the new version, just start $SCRIPT_NAME again."
|
||||
exit 0
|
||||
fi
|
||||
;;
|
||||
|
|
Loading…
Reference in a new issue