Skip to content

Commit b53f7d7

Browse files
committed
Fixed a bug prodedure / standard variations on some newly created Ubuntu preconfgiured system image file distributions.
1 parent 2a8deef commit b53f7d7

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

system-info

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#### Variables
3434
########################################################################
3535
# Versioning
36-
version="Version: 01.00-10, Script Date: 2022.06.03"
36+
version="Version: 01.00-11, Script Date: 2022.06.06"
3737
#md5_sum=$(md5sum $sname | sed 's/system.*//g' )
3838
arg1=$1
3939
arg2=$2
@@ -858,10 +858,20 @@ function GetInstallMedia()
858858
# Only displays if it was installed traditionally
859859
if [ -d /var/log/installer/ ]
860860
then
861-
installer_media=$(sudo head -n 1 /var/log/installer/media-info | awk '{print "Original Installation Media: "$0}' )
862-
echo -e "$installer_media"
861+
# Check to See if the media-info file was created before trying to read it...
862+
# On some pre-created Ubuntu Image Files now available, the /var/log/installer directory exists
863+
# but the files within that directory have been removed before release for distribution.
864+
if [ -f /var/log/installer/media-info ]
865+
then
866+
installer_media=$(sudo head -n 1 /var/log/installer/media-info | awk '{print "Original Installation Media: "$0}' )
867+
echo -e "$installer_media"
868+
else
869+
echo -e "The Installer log directory exists, but the Installer log files have been removed."
870+
echo -e "This system may have been installed from a distribution image file."
871+
fi
863872
else
864-
echo -e "Original Installation Media: Cannot determine which ISO this was installed from. May have been an image file."
873+
echo -e "Original Installation Media: Cannot determine which ISO this was installed from. "
874+
echo =e "The Installer Log Directory does not exist. May have been from a preconfigured image file."
865875
fi
866876
}
867877

0 commit comments

Comments
 (0)