mirror of
https://github.com/smxi/inxi.git
synced 2025-01-31 18:12:21 +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"
|
grep -q "^[0-${VERBOSITY_LEVELS}]$" <<< $VERBOSITY_LEVEL || error_handler 4 "$VERBOSITY_LEVEL"
|
||||||
;;
|
;;
|
||||||
-U)
|
-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 "$?"
|
wget -O $SCRIPT_PATH/$SCRIPT_NAME http://techpatterns.com/downloads/distro/$SCRIPT_NAME || error_handler 8 "$?"
|
||||||
if [ "$?" -eq 0 ];then
|
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
|
exit 0
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in a new issue