mmcheck has now advanced to version 2.00 as I add more tests and combine some options and regroup like tests together. The application verify functions that normally produces no output if there are no problems are grouped into two tests at the bottom of the list. There are other changes as well. mmcheck is about as large as can be posted online.
Just as before, copy and past the text in the following code block into a text file and save it in your home area as the file mmcheck (~/bin/mmcheck).
#!/bin/bash
#: Title : mmcheck - MultiMedia Check
#: Date Created: Sun Oct 3 15:42:01 CDT 2010
#: Last Edit : Sat Nov 6 08:36:10 CDT 2010
#: Author : J. McDaniel
#: Version : 2.00
#: Description : Check Your Installed Files for Multimedia
#: Options : none
# Written for the openSUSE forums on Saturday November 6, 2010
# Copy and paste this text as the file mmcheck into the ~/bin folder.
# Run the terminal command: chmod +x ~/bin/mmcheck, to make the file executable
# Open up a terminal session and type: mmcheck, to start the program
PROG="MultiMedia Application Checker - Version 2.00 - OS:"
function rpm_verify {
echo
echo "If everything verified properly there will be no output. If there are any "
echo "discrepancies they will be displayed. The format of the output is a string "
echo "of 8 characters, a possible 'c' denoting a configuration file, and then "
echo "the file name. Each of the 8 characters denotes the result of a comparison "
echo "of one attribute of the file to the value of that attribute recorded in the "
echo "RPM database. A single "." (period) means the test passed. The following "
echo "characters denote failure of certain tests: "
echo
echo " 5 -- MD5 checksum "
echo " S -- File size "
echo " L -- Symbolic link "
echo " T -- File modification time "
echo " D -- Device "
echo " U -- User "
echo " G -- Group "
echo " M -- Mode (includes permissions and file type) "
echo " ? -- Unreadable file "
echo
echo "Applications that are not installed will produce no"
echo "error message here should the program be missing."
}
# Determine program user, save home folder location
USER="$HOME"
# Menu Display System function
# Display up to $3 menu items and <enter> is always Exit
# Menu should have at least two choices plus exit
function print_menu {
# You can adjust the starting position of the mmcheck menu.
# Using s_line=0 & s_col=0 would place the menu in the top left corner of your screen"
# Starting Terminal Line Number for menu
s_line=0
# Starting Terminal Column Number for Menu
s_col=0
# Determine SuSE Version
suse=$(cat /etc/SuSE-release)
num=${#suse}
version="${suse:0:$((num - 15))}"
# Display Program Title
tput clear
tput cup $(( s_line )) $(( s_col ))
tput setf 7
tput setb 2
tput bold
echo "$1""$version"
# Determine Kernel Version
kernel=$(uname -r)
# Display Menu, Present User home, kernel version
tput sgr0
tput cup $(( s_line + 2 )) $(( s_col ))
tput setf 7
tput setb 1
tput bold
echo "$2" "USER:$USER" " Kernel:$kernel"
tput sgr0
# Display All Menu Options 1 through $3
maxnum=$3
counter=0
while $(( counter )) -lt $(( maxnum + 1 )) ] ; do
let counter=counter+1
tput cup $(( s_line + 3 + counter )) $(( s_col ))
echo "$4"
shift
done
# Display menu option request and get user input
tput setf 2
tput bold
tput cup $(( s_line + 4 + counter )) $(( s_col ))
read -p "Enter Your Choice [1-"$maxnum"] .... OR .... Just Press <enter> to Quit mmcheck : " CHOICE
tput clear
tput sgr0
tput rc
return $CHOICE
}
#Display One or More Line(s) with different foreground and background colors
function print_color {
fgrd=$1
bgrd=$2
maxnum=$3
counter=1
tput bold
tput setf $(( fgrd ))
tput setb $(( bgrd ))
while $(( counter )) -lt $(( maxnum + 1 )) ] ; do
echo "$4"
let counter=counter+1
shift
done
tput sgr0
echo
}
# Press Enter to Continue Request
function press_enter {
echo
read -p "Press <enter> to continue..."
}
# Libdvdcss file repository source warning
function libdvd_warn {
echo
echo "If you have installed libdvdcss from openSUSE, you do not need libdvdcss"
echo "from VideoLAN. So having no files from VideoLAN is OK, but if you do, it"
echo "should only be the package libdvdcss. In the future we suggest that you"
echo "switch to using only openSUSE and to remove the VideoLAN Repository. "
echo "Only openSUSE 11.3 is supported at: http://opensuse-guide.org/repo/11.3/"
}
#
# Main Program Loop starts here ...
#
while true ; do
# Setup Menu string Fields displayed for your menu
MENU="Multimedia Test Selection - M E N U "
TOTL="15"
TST1="1 . Check for any Missing Dependencies for ALL Installed Packages ... "
TST2="2 . Display All openSUSE Repositories as Entered in your Computer ... "
TST3="3 . Check for any Packages Installed from the VideoLAN Repository ... "
TST4="4 . Show the libdvdcss Package is Installed to View DVD Movies ... "
TST5="5 . Show if xine Packages are Installed & from Packman ... "
TST6="6 . Show if Mplayer Packages are Installed & from Packman ... "
TST7="7 . Show if gstreamer Plugins/Codecs are Installed & from Packman ... "
TST8="8 . Show if ffmpeg, lame & libmad0 Packages are Installed & from Packman ..."
TST9="9 . Show if Quicktime Package is Installed & from Packman ... "
TSTA="10. Show if vlc Packages are Installed & from Packman ... "
TSTB="11. Show if Totem Player Packages are Installed & from openSUSE ... "
TSTC="12. Show if Flash Packages are Installed & from openSUSE ... "
TSTD="13. Show if Java Packages are Installed & from openSUSE ... "
TSTE="14. Verify the Basic Installed Multimedia Packages ... "
TSTF="15. Verify the MPlayer, gstreamer, xine, VLC and w32codec-all Packages ... "
# Call Menu and get user input selection
print_menu "$PROG" "$MENU" "$TOTL" "$TST1" "$TST2" "$TST3" "$TST4" "$TST5" "$TST6" "$TST7" "$TST8" "$TST9" "$TSTA" "$TSTB" "$TSTC" "$TSTD" "$TSTE" "$TSTF"
CHOICE="$?"
# Execute User Command Here
case "$CHOICE" in
"1")
l1="Before Checking Your Repositories, would you like "
l2="to perform a Zypper Refresh right now? (Yes or No)"
print_color 7 1 2 "$l1" "$l2"
read -p "Enter your choice [y/N] " CHOICE
if "$CHOICE" == "y" ] || "$CHOICE" == "Y" ] ; then
sudo zypper refresh
fi
echo
print_color 7 4 1 "$TST1"
print_color 7 1 1 "Command: LC_ALL=C zypper ve"
LC_ALL=C zypper ve
press_enter ;;
"2")
print_color 7 4 1 "$TST2"
print_color 7 1 1 "Command: zypper repos "
zypper repos
echo
l1="If you have more than the four repositories listed above, you could cause yourself "
l2="some trouble. In general, repositories must given a priority when you have "
l3="more than four. If you do not understand how this works, please ask for help. "
l4="Listed below are the recommended repositories you should keep enabled. "
print_color 7 1 4 "$l1" "$l2" "$l3" "$l4"
l1=" * Main Repository - http://download.opensuse.org/distribution/11.?/repo/oss/ "
l2=" * Main Repository - http://download.opensuse.org/distribution/11.?/repo/non-oss/ "
l3=" * Packman Repository - http://packman.jacobs-university.de/suse/11.?/ "
l4=" * Main Update Repository - http://download.opensuse.org/update/11.?/ "
print_color 7 4 4 "$l1" "$l2" "$l3" "$l4"
press_enter ;;
"3")
print_color 7 4 1 "$TST3"
print_color 7 1 1 "Command: rpm -qa --queryformat '%{NAME} -> %{VENDOR}
' | grep -i VideoLAN"
rpm -qa --queryformat '%{NAME} -> %{VENDOR}
' | grep -i VideoLAN
libdvd_warn
press_enter ;;
"4")
print_color 7 4 1 "$TST4"
print_color 7 1 1 "Command: rpm --query --all --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' '*libdvdcss*'"
rpm --query --all --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' '*libdvdcss*'
libdvd_warn
press_enter ;;
"5")
print_color 7 4 1 "$TST5"
print_color 7 1 1 "Command: rpm --query --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' libxine1 libxine1-codecs"
rpm --query --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' libxine1 libxine1-codecs
echo
echo "You should expect to have two libxine packages installed and all from Packman."
echo "----------------> libxine1 <--------------------- from the Packman Repository."
echo "----------------> libxine1-codecs <-------------- from the Packman Repository."
press_enter ;;
"6")
print_color 7 4 1 "$TST6"
print_color 7 1 1 "Command: rpm --query --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' MPlayer mplayerplug-in"
rpm --query --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' MPlayer mplayerplug-in
echo
echo "You should expect to have two MPLayer packages installed and all from Packman."
echo "----------------> MPlayer <---------------------- from the Packman Repository."
echo "----------------> mplayerplug-in <--------------- from the Packman Repository."
press_enter ;;
"7")
print_color 7 4 1 "$TST7"
print_color 7 1 1 "Command: --query --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' 'gstreamer*'"
rpm --query --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' gstreamer-0_10-ffmpeg gstreamer-0_10-fluendo-mp3 gstreamer-0_10-fluendo-mpegdemux gstreamer-0_10-fluendo-mpegmux gstreamer-0_10-plugins-bad gstreamer-0_10-plugins-base gstreamer-0_10-plugins-good gstreamer-0_10-plugins-good-extra gstreamer-0_10-plugins-ugly
echo
echo "You should expect to have all 9 gstreamer packages installed and all from Packman."
press_enter ;;
"8")
print_color 7 4 1 "$TST8"
print_color 7 1 1 "Command: rpm --query --all --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' ffmpeg lame libmad0"
rpm --query --all --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' ffmpeg lame libmad0
echo
echo "You should expect to show three Packages Installed here from Packman."
echo "called ---------> libmad0 <------------- from the Packman Repository."
echo "called ---------> lame <---------------- from the Packman Repository."
echo "called ---------> ffmpeg <-------------- from the Packman Repository."
press_enter ;;
"9")
print_color 7 4 1 "$TST9"
print_color 7 1 1 "Command: rpm --query --all --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' '*quicktime*'"
rpm --query --all --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' '*quicktime*'
echo
echo "You should expect to have only one Quicktime Package Installed"
echo "called ----> libquicktime0 <---- from the Packman Repository."
press_enter ;;
"10")
print_color 7 4 1 "$TSTA"
print_color 7 1 1 "Command: rpm --query --all --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' vlc vlc-mozillaplugin libvlc5 libvlccore4"
rpm --query --all --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' vlc vlc-mozillaplugin libvlc5 libvlccore4
echo
echo "You should expect to show four Packages Installed here from Packman."
echo "called ---------> vlc <---------------- from the Packman Repository."
echo "called ---------> vlc-mozillaplugin <---from the Packman Repository."
echo "called ---------> libvlccore4 <-------- from the Packman Repository."
echo "called ---------> libvlc5 <------------ from the Packman Repository."
press_enter ;;
"11")
print_color 7 4 1 "$TSTB"
print_color 7 1 1 "Command: rpm --query --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' '*totem*'"
rpm --query --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' totem totem-browser-plugin totem-plugin-upnp totem-plugins nautilus-totem
echo
echo "Totem is normally associated with the Gnome Package, but may help in KDE as well."
echo
echo "You should expect to have about five Totem Packages Installed total which will be:"
echo "----------------> totem <--------------------------- from the openSUSE Repository."
echo "----------------> totem-browser-plugin <------------ from the openSUSE Repository."
echo "----------------> totem-plugin-upnp <--------------- from the openSUSE Repository."
echo "----------------> totem-plugins <------------------- from the openSUSE Repository."
echo "----------------> nautilus-totem <------------------ from the openSUSE Repository."
press_enter ;;
"12")
print_color 7 4 1 "$TSTC"
print_color 7 1 1 "Command: rpm --query --all --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' '*flash*'"
rpm --query --all --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' '*flash*'
echo
echo "You should expect to have only two Flash Packages Installed which will be:"
echo "----------------> pullin-flash-player <----- from the openSUSE Repository."
echo "----------------> flash-player <------------ from the openSUSE Repository."
press_enter ;;
"13")
print_color 7 4 1 "$TSTD"
print_color 7 1 1 "Command: rpm --query --all --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' '*java-*'"
rpm --query --all --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' '*java-*'
echo
echo "You should expect to have only Sun Java Packages installed. If your files "
echo "include the name --> openjdk <--, it is suggested that they be uninstalled."
press_enter ;;
"14")
print_color 7 4 1 "$TSTE"
print_color 7 1 1 "Command: rpm --verify --query --all 'libav*' 'libpostproc*' 'libswscale*'"
rpm --verify --query --all 'libav*' 'libpostproc*' 'libswscale*'
rpm_verify
press_enter ;;
"15")
print_color 7 4 1 "$TSTF"
print_color 7 1 1 "Command: rpm --verify --query --all MPlayer '*vlc*' '*gst*' '*xine*' w32codec-all"
rpm --verify --query --all MPlayer '*vlc*' '*gst*' 'xine*' w32codec-all
rpm_verify
echo
echo "w32codec-all is only required on 32 bit systems "
echo "and only provides some very rare audio formats."
press_enter ;;
"0")
tput clear
l1=" To avoid package problems, the most important thing to do is to: **NEVER** "
l2=" ignore a dependency, even if YaST/zypper/updater gives you such an option! "
l3=" Change vendor is OK, but ignoring dependencies is never a very good idea. "
print_color 7 4 3 "$l1" "$l2" "$l3"
press_enter
exit 0 ;;
*) ;;
esac
done
exit 0
# End of Bash File
Next, you need to mark the mmcheck script as executable. Open a terminal session and run this command:
chmod +x ~/bin/mmcheck
Finally, to use mmcheck, open another terminal session and type the command:
mmcheck
If you know of a check that should be made to ensure some multimedia operation, let me know and it can be added.
Thank You,