Adding version number output for updating feature

This commit is contained in:
inxi-svn 2008-10-30 22:22:59 +00:00
parent c63f96f40e
commit ae63e9973b

5
inxi
View file

@ -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
;;