MMCHECK - Check Your Multimedia in 10 Steps - Script File, as proposed by RedDwarf

I have decided to create a script file to automate the task of testing your multimedia as suggested in this original message by RedDwarf:

Check your multimedia problem in ten steps

To Create the script file, copy and paste the following text into a text editor like kwrite and then save the file as mmcheck in your home area bin folder (~/bin/mmcheck).

#!/bin/bash

#: Title       : /home/james/bin/mmcheck
#: Date Created: Sun Oct 3 15:42:01 CDT 2010
#: Last Edit   : Mon Oct 4 19:54:00 CDT 2010
#: Author      : by RedDwarf & J. McDaniel
#: Version     : 1.00
#: Description : Check Your Installed Files for Mutimedia
#: Options     : none

# Written for the openSUSE forums on Sunday October 4, 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 Check Version 1.00  -  Check for multimedia problems in just 10 steps  "

# Determine program user, save home folder location, request root password

USER="$HOME"

# Menu Disply System function
# Display up to 10 menu items and 0 is always Exit 
# Menu must 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=1
# Starting Terminal Column Number for Menu
s_col=1

# Display Program Title
tput clear
tput cup $(( s_line )) $(( s_col ))
tput setf 7
tput setb 2
tput bold
echo "$1"

# Fetch kernel version to display
# uname -r > ~/kernel.dat
# read kernel < ~/kernel.dat
# rm ~/kernel.dat

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" " "

# Display Option for Line 1 (required)
tput sgr0
tput cup $(( s_line + 4 )) $(( s_col ))
echo "$5"

# Display Option for Line 2 (required)
if  $4 -ge 2 ] ; then
  tput cup $(( s_line + 5 )) $(( s_col ))
  echo "$6"
  tput cup $(( s_line + 6 )) $(( s_col ))
  echo "$3"
  tput cup $(( s_line + 8 )) $(( s_col ))
fi


# Display Option for Line 3 (optional)
if  $4 -ge 3 ] ; then
  tput cup $(( s_line + 6 )) $(( s_col ))
  echo "$7"
  tput cup $(( s_line + 7 )) $(( s_col ))
  echo "$3"
  tput cup $(( s_line + 9 )) $(( s_col ))
fi

# Display Option for Line 4 (optional)
if  $4 -ge 4 ] ; then
  tput cup $(( s_line + 7 )) $(( s_col ))
  echo "$8"
  tput cup $(( s_line + 8 )) $(( s_col ))
  echo "$3"
  tput cup $(( s_line + 10 )) $(( s_col ))
fi

# Display Option for Line 5 (optional)
if  $4 -ge 5 ] ; then
  tput cup $(( s_line + 8 )) $(( s_col ))
  echo "$9"
  tput cup $(( s_line + 9 )) $(( s_col ))
  echo "$3"
  tput cup $(( s_line + 11 )) $(( s_col ))
fi

# Display Option for Line 6 (optional)
if  $4 -ge 6 ] ; then
  tput cup $(( s_line + 9 )) $(( s_col ))
  echo "${10}"
  tput cup $(( s_line + 10 )) $(( s_col ))
  echo "$3"
  tput cup $(( s_line + 12 )) $(( s_col ))
fi

# Display Option for Line 7 (optional)
if  $4 -ge 7 ] ; then
  tput cup $(( s_line + 10 )) $(( s_col ))
  echo "${11}"
  tput cup $(( s_line + 11 )) $(( s_col ))
  echo "$3"
  tput cup $(( s_line + 13 )) $(( s_col ))
fi

# Display Option for Line 8 (optional)
if  $4 -ge 8 ] ; then
  tput cup $(( s_line + 11 )) $(( s_col ))
  echo "${12}"
  tput cup $(( s_line + 12 )) $(( s_col ))
  echo "$3"
  tput cup $(( s_line + 14 )) $(( s_col ))
fi

# Display Option for Line 9 (optional)
if  $4 -ge 9 ] ; then
  tput cup $(( s_line + 12 )) $(( s_col ))
  echo "${13}"
  tput cup $(( s_line + 13 )) $(( s_col ))
  echo "$3"
  tput cup $(( s_line + 15 )) $(( s_col ))
fi

# Display Option for Line 10 (optional)
if  $4 -ge 10 ] ; then
  tput cup $(( s_line + 13 )) $(( s_col ))
  echo "${14}"
  tput cup $(( s_line + 14 )) $(( s_col ))
  echo "$3"
  tput cup $(( s_line + 16 )) $(( s_col ))
fi

# Display menu option request and get user input
tput setaf 2
tput bold
read -p "Enter your choice [0-"$4"] " CHOICE
tput clear
tput sgr0
tput rc
return $CHOICE
}

# Main Program Loop starts here ...

while true ; do

# Setup Menu string Fields displayed for your menu

MENU=" Mutimedia Test Selection - M E N U "
EXIT=" 0 . Exit Mutimedia Test Selection Menu                                           "
TOTL="10" 
TST1=" 1 . Check if there are any missing dependencies for installed packages ...       "
TST2=" 2 . Check if there are packages installed from the VideoLAN repository ...       "
TST3=" 3 . Check your basic installed multimedia packages ...                           "
TST4=" 4 . Verify you have xine installed and installed from Packman ...                "
TST5=" 5 . Check your xine packages ...                                                 "
TST6=" 6 . Verify you have all the gstreamer plugins (codecs) installed from Packman ..."
TST7=" 7 . Check your gstreamer packages ...                                            "
TST8=" 8 . Check your MPlayer package ...                                               "
TST9=" 9 . Check your VLC packages ...                                                  "
TSTA=" 10. Check your w32codec package ...                                              "

# Call Menu and get user input selection

print_menu "$PROG" "$MENU" "$EXIT" "$TOTL" "$TST1" "$TST2" "$TST3" "$TST4" "$TST5" "$TST6" "$TST7" "$TST8" "$TST9" "$TSTA"
choice="$?"

# Execute User Command Here

case "$choice" in

  "1") tput setf 3
  echo $TST1
  tput sgr0
  echo 
  LC_ALL=C zypper ve
  echo
  read -p "Press <enter> to continue..." ;;

  "2") tput setf 3
  echo $TST2
  tput sgr0
  echo  
  rpm -qa --queryformat '%{NAME} -> %{VENDOR}
' | grep -i VideoLAN
  echo
  echo "Only libdvdcss should be installed from the VideoLAN repository."
  echo
  read -p "Press <enter> to continue..." ;;

  "3") tput setf 3
  echo $TST3
  tput sgr0
  echo 
  rpm --verify --query --all 'libav*' 'libpostproc*' 'libswscale*'
  echo
  echo "No report is good, though not all problems are bad."
  echo
  read -p "Press <enter> to continue..." ;;

  "4") tput setf 3
  echo $TST4
  tput sgr0
  echo 
  rpm --query --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' libxine1 libxine1-codecs
  echo
  read -p "Press <enter> to continue..." ;;
 
  "5") tput setf 3
  echo $TST5
  tput sgr0
  echo 
  rpm --verify --query --all '*xine*'
  echo
  read -p "Press <enter> to continue..." ;;

  "6") tput setf 3
  echo $TST6
  tput sgr0
  echo 
  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
  read -p "Press <enter> to continue..." ;;

  "7") tput setf 3
  echo $TST7
  tput sgr0
  echo 
  rpm --verify --query --all '*gst*'
  echo
  echo "No report is good, though not all problems are bad."
  echo
  read -p "Press <enter> to continue..." ;;

  "8") tput setf 3
  echo $TST8
  tput sgr0
  echo 
  rpm --verify MPlayer
  echo
  echo "No report is good, though not all problems are bad."
  echo
  read -p "Press <enter> to continue..." ;;

  "9") tput setf 3
  echo $TST9
  tput sgr0
  echo 
  rpm --verify --query --all '*vlc*'
  echo
  echo "No report is good, though not all problems are bad."
  echo
  read -p "Press <enter> to continue..." ;;

  "10") tput setf 3
  echo $TSTA
  echo 
  rpm --verify w32codec-all
  tput sgr0
  echo
  echo "Note that this package only adds support for some rare formats, and only"
  echo "works on 32bits systems.  On a x86-64 system it will not make any difference."
  echo
  read -p "Press <enter> to continue..." ;;

  "0") tput clear
  tput setf 2
  tput bold
  echo
  echo "To avoid problems... the most important thing I can say to you: even if YaST/zypper/updater gives you such an option...  ***NEVER*** "
  echo "ignore a dependency. Change vendor is ok, ignore dependencies is never is a good idea. See the following forum post for more details."
  echo
  echo "http://forums.opensuse.org/english/get-help-here/multimedia/400119-check-your-multimedia-problem-ten-steps.html#post1898049"
  tput sgr0
  echo
  exit 0 ;;

  *) ;;

esac

done 

exit 0

# End of Bash File


After you have save the text, you need to make the script file executable. Open up a terminal session and type the command:

chmod +x ~/bin/mmcheck

Once the script file has been created and made executable, you only need to open another terminal session, such as konsole and type the command:

mmcheck

Here is what the mmcheck menu looks like.


 MultiMedia Check Version 1.00  -  Check for multimedia problems in just 10 steps  

  Mutimedia Test Selection - M E N U  USER:/home/james  Kernel:2.6.35.5-6-desktop  

  1 . Check if there are any missing dependencies for installed packages ...       
  2 . Check if there are packages installed from the VideoLAN repository ...       
  3 . Check your basic installed multimedia packages ...                           
  4 . Verify you have xine installed and installed from Packman ...                
  5 . Check your xine packages ...                                                 
  6 . Verify you have all the gstreamer plugins (codecs) installed from Packman ...
  7 . Check your gstreamer packages ...                                            
  8 . Check your MPlayer package ...                                               
  9 . Check your VLC packages ...                                                  
  10. Check your w32codec package ...                                              
  0 . Exit Mutimedia Test Selection Menu                                           

 Enter your choice [0-10] 

Please let me know if you have any questions about the script, have any suggestions or any problems using this program.

Thank You,

Hello James

Thank you. It works. Helped me to clean up my installation.

The only glitch I noticed is that the title line is longer than 80 characters and wraps around.

                 Hello James

Thank you. It works. Helped me to clean up my installation.

The only glitch I noticed is that the title line is longer than 80 characters and wraps around.
Thank you voodo for your kind words. If I should repost the script for any reason, I shall shorten all lines to 80 characters or less. I failed to check that this time. I will not forget next time.

Thank You,

Here in version 1.01 I have added more color to the 10 tests and now present the actual command being run so you can see both the command and the result. Where I could, I did shorten displayed text.

As before, copy the text in the following code block into a text editor and then save the file as mmcheck in your home area bin folder (~/bin/mmcheck).

#!/bin/bash

#: Title       : /home/james/bin/mmcheck
#: Date Created: Sun Oct 3 15:42:01 CDT 2010
#: Last Edit   : Sat Oct 23 14:37:05 CDT 2010
#: Author      : by RedDwarf & J. McDaniel
#: Version     : 1.01
#: Description : Check Your Installed Files for Mutimedia
#: Options     : none

# Written for the openSUSE forums on Sunday October 23, 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 Check Version 1.01 - Check for multimedia problems in just 10 steps "

# Determine program user, save home folder location, request root password

USER="$HOME"

# Menu Disply System function
# Display up to 10 menu items and 0 is always Exit 
# Menu must 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=3
# Starting Terminal Column Number for Menu
s_col=33

# Display Program Title
tput clear
tput cup $(( s_line )) $(( s_col ))
tput setf 7
tput setb 2
tput bold
echo "$1"

# 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" 

# Display Option for Line 1 (required)
tput sgr0
tput cup $(( s_line + 4 )) $(( s_col ))
echo "$5"

# Display Option for Line 2 (required)
if  $4 -ge 2 ] ; then
  tput cup $(( s_line + 5 )) $(( s_col ))
  echo "$6"
  tput cup $(( s_line + 6 )) $(( s_col ))
  echo "$3"
  tput cup $(( s_line + 8 )) $(( s_col ))
fi


# Display Option for Line 3 (optional)
if  $4 -ge 3 ] ; then
  tput cup $(( s_line + 6 )) $(( s_col ))
  echo "$7"
  tput cup $(( s_line + 7 )) $(( s_col ))
  echo "$3"
  tput cup $(( s_line + 9 )) $(( s_col ))
fi

# Display Option for Line 4 (optional)
if  $4 -ge 4 ] ; then
  tput cup $(( s_line + 7 )) $(( s_col ))
  echo "$8"
  tput cup $(( s_line + 8 )) $(( s_col ))
  echo "$3"
  tput cup $(( s_line + 10 )) $(( s_col ))
fi

# Display Option for Line 5 (optional)
if  $4 -ge 5 ] ; then
  tput cup $(( s_line + 8 )) $(( s_col ))
  echo "$9"
  tput cup $(( s_line + 9 )) $(( s_col ))
  echo "$3"
  tput cup $(( s_line + 11 )) $(( s_col ))
fi

# Display Option for Line 6 (optional)
if  $4 -ge 6 ] ; then
  tput cup $(( s_line + 9 )) $(( s_col ))
  echo "${10}"
  tput cup $(( s_line + 10 )) $(( s_col ))
  echo "$3"
  tput cup $(( s_line + 12 )) $(( s_col ))
fi

# Display Option for Line 7 (optional)
if  $4 -ge 7 ] ; then
  tput cup $(( s_line + 10 )) $(( s_col ))
  echo "${11}"
  tput cup $(( s_line + 11 )) $(( s_col ))
  echo "$3"
  tput cup $(( s_line + 13 )) $(( s_col ))
fi

# Display Option for Line 8 (optional)
if  $4 -ge 8 ] ; then
  tput cup $(( s_line + 11 )) $(( s_col ))
  echo "${12}"
  tput cup $(( s_line + 12 )) $(( s_col ))
  echo "$3"
  tput cup $(( s_line + 14 )) $(( s_col ))
fi

# Display Option for Line 9 (optional)
if  $4 -ge 9 ] ; then
  tput cup $(( s_line + 12 )) $(( s_col ))
  echo "${13}"
  tput cup $(( s_line + 13 )) $(( s_col ))
  echo "$3"
  tput cup $(( s_line + 15 )) $(( s_col ))
fi

# Display Option for Line 10 (optional)
if  $4 -ge 10 ] ; then
  tput cup $(( s_line + 13 )) $(( s_col ))
  echo "${14}"
  tput cup $(( s_line + 14 )) $(( s_col ))
  echo "$3"
  tput cup $(( s_line + 16 )) $(( s_col ))
fi

# Display menu option request and get user input
tput setaf 2
tput bold
read -p "Enter your choice [0-"$4"] " CHOICE
tput clear
tput sgr0
tput rc
return $CHOICE
}

# Main Program Loop starts here ...

while true ; do

# Setup Menu string Fields displayed for your menu

MENU="Mutimedia Test Selection - M E N U "
EXIT=" 0 . Exit Mutimedia Test Selection Menu                                         "
TOTL="10" 
TST1=" 1 . Check if there are any missing dependencies for installed packages ...     "
TST2=" 2 . Check if there are packages installed from the VideoLAN repository ...     "
TST3=" 3 . Check your basic installed multimedia packages ...                         "
TST4=" 4 . Verify you have xine installed and installed from Packman ...              "
TST5=" 5 . Check your xine packages ...                                               "
TST6=" 6 . Verify you have all the gstreamer plugins/codecs installed from Packman ..."
TST7=" 7 . Check your gstreamer packages ...                                          "
TST8=" 8 . Check your MPlayer package ...                                             "
TST9=" 9 . Check your VLC packages ...                                                "
TSTA=" 10. Check your w32codec package ...                                            "

# Call Menu and get user input selection

print_menu "$PROG" "$MENU" "$EXIT" "$TOTL" "$TST1" "$TST2" "$TST3" "$TST4" "$TST5" "$TST6" "$TST7" "$TST8" "$TST9" "$TSTA"
choice="$?"

# Execute User Command Here

case "$choice" in

  "1") tput bold
  tput setf 7
  tput setb 4
  echo $TST1
  echo
  tput setf 7
  tput setb 1
  tput bold
  echo "Command: LC_ALL=C zypper ve"
  tput sgr0
  echo
  LC_ALL=C zypper ve
  echo
  read -p "Press <enter> to continue..." ;;

  "2") tput bold
  tput setf 7
  tput setb 4
  echo $TST2
  echo
  tput setf 7
  tput setb 1
  tput bold
  echo "Command: rpm -qa --queryformat '%{NAME} -> %{VENDOR}
' | grep -i VideoLAN"
  tput sgr0
  echo  
  rpm -qa --queryformat '%{NAME} -> %{VENDOR}
' | grep -i VideoLAN
  echo
  echo "Only libdvdcss should be installed from the VideoLAN repository."
  echo
  read -p "Press <enter> to continue..." ;;

  "3") tput bold
  tput setf 7
  tput setb 4
  echo $TST3
  echo
  tput setf 7
  tput setb 1
  tput bold
  echo "Command: rpm --verify --query --all 'libav*' 'libpostproc*' 'libswscale*'"
  tput sgr0
  echo
  rpm --verify --query --all 'libav*' 'libpostproc*' 'libswscale*'
  echo
  echo "No report is good, though not all problems are bad."
  echo
  read -p "Press <enter> to continue..." ;;

  "4") tput bold
  tput setf 7
  tput setb 4
  echo $TST4
  echo
  tput setf 7
  tput setb 1
  tput bold
  echo "Command: rpm --query --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' libxine1 libxine1-codecs"
  tput sgr0
  echo
  rpm --query --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' libxine1 libxine1-codecs
  echo
  read -p "Press <enter> to continue..." ;;
 
  "5") tput bold
  tput setf 7
  tput setb 4
  echo $TST5
  echo
  tput setf 7
  tput setb 1
  tput bold
  echo "Command: rpm --verify --query --all '*xine*'"
  tput sgr0
  echo
  rpm --verify --query --all '*xine*'
  echo
  read -p "Press <enter> to continue..." ;;

  "6") tput bold
  tput setf 7
  tput setb 4
  echo $TST6
  echo 
  tput setf 7
  tput setb 1
  tput bold
  echo "Command: --query --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
'"
  tput sgr0
  echo
  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
  read -p "Press <enter> to continue..." ;;

  "7") tput bold
  tput setf 7
  tput setb 4
  echo $TST7
  echo
  tput setf 7
  tput setb 1
  tput bold
  echo "Command: rpm --verify --query --all '*gst*'"
  tput sgr0
  echo
  rpm --verify --query --all '*gst*'
  echo
  echo "No report is good, though not all problems are bad."
  echo
  read -p "Press <enter> to continue..." ;;

  "8") tput bold
  tput setf 7
  tput setb 4
  echo $TST8
  echo
  tput setf 7
  tput setb 1
  tput bold
  echo "Command:  rpm --verify MPlayer"
  tput sgr0
  echo
  rpm --verify MPlayer
  echo
  echo "No report is good, though not all problems are bad."
  echo
  read -p "Press <enter> to continue..." ;;

  "9") tput bold
  tput setf 7
  tput setb 4
  echo $TST9
  echo
  tput setf 7
  tput setb 1
  tput bold
  echo "Command: rpm --verify --query --all '*vlc*'"
  tput sgr0
  echo
  rpm --verify --query --all '*vlc*'
  echo
  echo "No report is good, though not all problems are bad."
  echo
  read -p "Press <enter> to continue..." ;;

  "10") tput bold
  tput setf 7
  tput setb 4
  echo $TSTA
  echo
  tput setf 7
  tput setb 1
  tput bold 
  echo "Command: rpm --verify w32codec-all"
  tput sgr0
  echo
  rpm --verify w32codec-all
  echo
  echo "Note that this package only adds support for some rare formats, and only"
  echo "works on 32bits systems.  On a x86-64 system it will not make any difference."
  echo
  read -p "Press <enter> to continue..." ;;

  "0") tput clear
  tput setf 2
  tput bold
  echo
  echo "To avoid problems... the most important thing I can say to you: even if YaST/"
  echo "zypper/updater gives you such an option...  ***NEVER*** ignore a dependency."
  echo "Change vendor is ok, ignore dependencies is never is a good idea. See the "
  echo "following forum post for more details."
  echo
  echo "http://forums.opensuse.org/english/get-help-here/multimedia/400119-check-your-multimedia-problem-ten-steps.html#post1898049"
  tput sgr0
  echo
  exit 0 ;;

  *) ;;

esac

done 

exit 0

# End of Bash File


To make mmcheck executable, open a terminal session and type the terminal command:

chmod +x ~/bin/mmcheck

To use mmcheck, open a terminal session and type the command:

mmcheck

You can create an icon on your desktop to run mmcheck by doing the following tasks. Open a text editor and copy the following text in and then save the file as mmcheck.desktop in your home area Desktop folder (~/Desktop/mmcheck.desktop).

[Desktop Entry]
Comment[en_US]=
Comment=
Exec=~/bin/mmcheck
GenericName[en_US]=Multimedia Check - In 10 Steps
GenericName=Multimedia Check - In 10 Steps
Icon=video-television
MimeType=                                                                                                                                     
Name[en_US]=mmcheck                                                                                                                           
Name=mmcheck                                                                                                                                  
Path=
StartupNotify=true
Terminal=true
TerminalOptions=
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=none
X-KDE-SubstituteUID=false
X-KDE-Username=
X-SuSE-translate=true

Once saved in the right place with the correct name an icon should appears on your desktop called mmcheck. I picked an icon of a monitor, but you could change it to anything you wanted.

Thank You,

Just in time for Halloween, I have updated mmcheck to 13 steps. These added steps include checking your Quicktime package, your Flash Packages (not 64 bit) and your Java packages. These are all helpful to know when using your Internet Browser. I have added text to explain the rpm --verify error messages should you get one. 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       : /home/james/bin/mmcheck
#: Date Created: Sun Oct 3 15:42:01 CDT 2010
#: Last Edit   : Tue Oct 26 20:13:05 CDT 2010
#: Author      : by RedDwarf & J. McDaniel
#: Version     : 1.10
#: Description : Check Your Installed Files for Mutimedia
#: Options     : none

# Written for the openSUSE forums on Tuesday October 26, 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 Check Version 1.10 - Check for multimedia problems in just 13 steps "

function rpm_verify {

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 "
}


# Determine program user, save home folder location, request root password

USER="$HOME"

# Menu Disply System function
# Display up to 10 menu items and 0 is always Exit 
# Menu must 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=1
# Starting Terminal Column Number for Menu
s_col=1

# Display Program Title
tput clear
tput cup $(( s_line )) $(( s_col ))
tput setf 7
tput setb 2
tput bold
echo "$1"

# 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" 

# Display Option for Line 1 (required)
tput sgr0
tput cup $(( s_line + 4 )) $(( s_col ))
echo "$5"

# Display Option for Line 2 (required)
if  $4 -ge 2 ] ; then
  tput cup $(( s_line + 5 )) $(( s_col ))
  echo "$6"
  tput cup $(( s_line + 6 )) $(( s_col ))
  echo "$3"
  tput cup $(( s_line + 8 )) $(( s_col ))
fi


# Display Option for Line 3 (optional)
if  $4 -ge 3 ] ; then
  tput cup $(( s_line + 6 )) $(( s_col ))
  echo "$7"
  tput cup $(( s_line + 7 )) $(( s_col ))
  echo "$3"
  tput cup $(( s_line + 9 )) $(( s_col ))
fi

# Display Option for Line 4 (optional)
if  $4 -ge 4 ] ; then
  tput cup $(( s_line + 7 )) $(( s_col ))
  echo "$8"
  tput cup $(( s_line + 8 )) $(( s_col ))
  echo "$3"
  tput cup $(( s_line + 10 )) $(( s_col ))
fi

# Display Option for Line 5 (optional)
if  $4 -ge 5 ] ; then
  tput cup $(( s_line + 8 )) $(( s_col ))
  echo "$9"
  tput cup $(( s_line + 9 )) $(( s_col ))
  echo "$3"
  tput cup $(( s_line + 11 )) $(( s_col ))
fi

# Display Option for Line 6 (optional)
if  $4 -ge 6 ] ; then
  tput cup $(( s_line + 9 )) $(( s_col ))
  echo "${10}"
  tput cup $(( s_line + 10 )) $(( s_col ))
  echo "$3"
  tput cup $(( s_line + 12 )) $(( s_col ))
fi

# Display Option for Line 7 (optional)
if  $4 -ge 7 ] ; then
  tput cup $(( s_line + 10 )) $(( s_col ))
  echo "${11}"
  tput cup $(( s_line + 11 )) $(( s_col ))
  echo "$3"
  tput cup $(( s_line + 13 )) $(( s_col ))
fi

# Display Option for Line 8 (optional)
if  $4 -ge 8 ] ; then
  tput cup $(( s_line + 11 )) $(( s_col ))
  echo "${12}"
  tput cup $(( s_line + 12 )) $(( s_col ))
  echo "$3"
  tput cup $(( s_line + 14 )) $(( s_col ))
fi

# Display Option for Line 9 (optional)
if  $4 -ge 9 ] ; then
  tput cup $(( s_line + 12 )) $(( s_col ))
  echo "${13}"
  tput cup $(( s_line + 13 )) $(( s_col ))
  echo "$3"
  tput cup $(( s_line + 15 )) $(( s_col ))
fi

# Display Option for Line 10 (optional)
if  $4 -ge 10 ] ; then
  tput cup $(( s_line + 13 )) $(( s_col ))
  echo "${14}"
  tput cup $(( s_line + 14 )) $(( s_col ))
  echo "$3"
  tput cup $(( s_line + 16 )) $(( s_col ))
fi

# Display Option for Line 11 (optional)
if  $4 -ge 11 ] ; then
  tput cup $(( s_line + 14 )) $(( s_col ))
  echo "${15}"
  tput cup $(( s_line + 15 )) $(( s_col ))
  echo "$3"
  tput cup $(( s_line + 17 )) $(( s_col ))
fi

# Display Option for Line 12 (optional)
if  $4 -ge 12 ] ; then
  tput cup $(( s_line + 15 )) $(( s_col ))
  echo "${16}"
  tput cup $(( s_line + 16 )) $(( s_col ))
  echo "$3"
  tput cup $(( s_line + 18 )) $(( s_col ))
fi

# Display Option for Line 13 (optional)
if  $4 -ge 13 ] ; then
  tput cup $(( s_line + 16 )) $(( s_col ))
  echo "${17}"
  tput cup $(( s_line + 17 )) $(( s_col ))
  echo "$3"
  tput cup $(( s_line + 19 )) $(( s_col ))
fi

# Display menu option request and get user input
tput setaf 2
tput bold
read -p "Enter your choice [0-"$4"] " CHOICE
tput clear
tput sgr0
tput rc
return $CHOICE
}

# Main Program Loop starts here ...

while true ; do

# Setup Menu string Fields displayed for your menu

MENU="Mutimedia Test Selection - M E N U "
EXIT=" 0 . Exit the Mutimedia Test Selection Menu ...                                 "
TOTL="13" 
TST1=" 1 . Check if there are any missing dependencies for installed packages ...     "
TST2=" 2 . Check if there are packages installed from the VideoLAN repository ...     "
TST3=" 3 . Check your basic installed multimedia packages ...                         "
TST4=" 4 . Verify you have xine installed and installed from Packman ...              "
TST5=" 5 . Check your xine packages (Anything with xine in its name is found)...      "
TST6=" 6 . Verify you have all the gstreamer plugins/codecs installed from Packman ..."
TST7=" 7 . Check your gstreamer packages ...                                          "
TST8=" 8 . Check your MPlayer package ...                                             "
TST9=" 9 . Check your VLC packages ...                                                "
TSTA=" 10. Check your w32codec package ...                                            "
TSTB=" 11. Verify your Quicktime Package is installed ...                             "
TSTC=" 12. Verify your Flash Packages are installed ...                               "
TSTD=" 13. Verify your Java Files are Installed ...                                   "

# Call Menu and get user input selection

print_menu "$PROG" "$MENU" "$EXIT" "$TOTL" "$TST1" "$TST2" "$TST3" "$TST4" "$TST5" "$TST6" "$TST7" "$TST8" "$TST9" "$TSTA" "$TSTB" "$TSTC" "$TSTD"
CHOICE="$?"

# Execute User Command Here

case "$CHOICE" in

  "1") tput bold
  tput setf 7
  tput setb 1
  echo "Before Checking Your Repositories, would you like "
  echo "to perform a Zypper Refresh right now? (Yes or No)"
  echo
  read -p "Enter your choice [y/N] " CHOICE
  if  "$CHOICE" == "y" ] ||  "$CHOICE" == "Y" ] ; then
    sudo zypper refresh
  fi
  echo
  tput bold
  tput setf 7
  tput setb 4
  echo $TST1
  echo
  tput setf 7
  tput setb 1
  tput bold
  echo "Command: LC_ALL=C zypper ve"
  tput sgr0
  echo
  LC_ALL=C zypper ve
  echo
  read -p "Press <enter> to continue..." ;;

  "2") tput bold
  tput setf 7
  tput setb 4
  echo $TST2
  echo
  tput setf 7
  tput setb 1
  tput bold
  echo "Command: rpm -qa --queryformat '%{NAME} -> %{VENDOR}
' | grep -i VideoLAN"
  tput sgr0
  echo  
  rpm -qa --queryformat '%{NAME} -> %{VENDOR}
' | grep -i VideoLAN
  echo
  echo "Only libdvdcss should be installed from the VideoLAN repository."
  echo
  read -p "Press <enter> to continue..." ;;

  "3") tput bold
  tput setf 7
  tput setb 4
  echo $TST3
  echo
  tput setf 7
  tput setb 1
  tput bold
  echo "Command: rpm --verify --query --all 'libav*' 'libpostproc*' 'libswscale*'"
  tput sgr0
  echo
  rpm --verify --query --all 'libav*' 'libpostproc*' 'libswscale*'
  echo
  rpm_verify
  echo
  read -p "Press <enter> to continue..." ;;

  "4") tput bold
  tput setf 7
  tput setb 4
  echo $TST4
  echo
  tput setf 7
  tput setb 1
  tput bold
  echo "Command: rpm --query --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' libxine1 libxine1-codecs"
  tput sgr0
  echo
  rpm --query --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' libxine1 libxine1-codecs
  echo
  read -p "Press <enter> to continue..." ;;
 
  "5") tput bold
  tput setf 7
  tput setb 4
  echo $TST5
  echo
  tput setf 7
  tput setb 1
  tput bold
  echo "Command: rpm --verify --query --all '*xine*'"
  tput sgr0
  echo
  rpm --verify --query --all '*xine*'
  echo
  rpm_verify
  echo
  read -p "Press <enter> to continue..." ;;

  "6") tput bold
  tput setf 7
  tput setb 4
  echo $TST6
  echo 
  tput setf 7
  tput setb 1
  tput bold
  echo "Command: --query --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' 'gstreamer*'"
  tput sgr0
  echo
  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
  read -p "Press <enter> to continue..." ;;

  "7") tput bold
  tput setf 7
  tput setb 4
  echo $TST7
  echo
  tput setf 7
  tput setb 1
  tput bold
  echo "Command: rpm --verify --query --all '*gst*'"
  tput sgr0
  echo
  rpm --verify --query --all '*gst*'
  echo
  rpm_verify
  echo
  read -p "Press <enter> to continue..." ;;

  "8") tput bold
  tput setf 7
  tput setb 4
  echo $TST8
  echo
  tput setf 7
  tput setb 1
  tput bold
  echo "Command:  rpm --verify MPlayer"
  tput sgr0
  echo
  rpm --verify MPlayer
  echo
  rpm_verify
  echo
  read -p "Press <enter> to continue..." ;;

  "9") tput bold
  tput setf 7
  tput setb 4
  echo $TST9
  echo
  tput setf 7
  tput setb 1
  tput bold
  echo "Command: rpm --verify --query --all '*vlc*'"
  tput sgr0
  echo
  rpm --verify --query --all '*vlc*'
  echo
  rpm_verify
  echo
  read -p "Press <enter> to continue..." ;;

  "10") tput bold
  tput setf 7
  tput setb 4
  echo $TSTA
  echo
  tput setf 7
  tput setb 1
  tput bold 
  echo "Command: rpm --verify w32codec-all"
  tput sgr0
  echo
  rpm --verify w32codec-all
  echo

  echo "Note that this package only adds support for some rare formats, and only"
  echo "works on 32bits systems.  On a x86-64 system it will not make any difference."
  echo
  rpm_verify
  echo
  read -p "Press <enter> to continue..." ;;

  "11") tput bold
  tput setf 7
  tput setb 4
  echo $TSTB
  echo
  tput setf 7
  tput setb 1
  tput bold 
  echo "rpm --query --all --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' '*quicktime*'"
  tput sgr0
  echo
  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."
  echo
  read -p "Press <enter> to continue..." ;;

  "12") tput bold
  tput setf 7
  tput setb 4
  echo $TSTC
  echo
  tput setf 7
  tput setb 1
  tput bold 
  echo "rpm --query --all --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' '*flash*'"
  tput sgr0
  echo
  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."
  echo
  read -p "Press <enter> to continue..." ;;

  "13") tput bold
  tput setf 7
  tput setb 4
  echo $TSTC
  echo
  tput setf 7
  tput setb 1
  tput bold 
  echo "rpm --query --all --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' *java-*'"
  tput sgr0
  echo
  rpm --query --all --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' '*java-*'
  echo
  echo "You should expect to have only Sun Java files installed. If your files" 
  echo "include the name --> openjdk <--, it is suggested they be uninstalled."
  echo
  read -p "Press <enter> to continue..." ;;

  "0") tput clear
  tput setf 2
  tput bold
  echo
  echo "To avoid problems... the most important thing to do is: even if YaST/  "
  echo "zypper/updater gives you such an option. **NEVER** ignore a dependency."
  echo "Change vendor is OK, ignore dependencies is never is a good idea.      "
  echo
  tput sgr0
  echo
  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

See my previous message on how to create an icon on your desktop to run mmcheck if you like.

Thank You,

After posting mmcheck version 1.10, I almost had a problem trying to post here due to how long the mmcheck script had become. The main problem in it size was how the menu display function was working, having almost the same code over and over. Now in version 1.20, I have condensed the way the menu display is working, taking up a lot less room. This should allow for the ability to add even more multimedia checking steps in the future. I also had one bug in the header display for step 13, which as been corrected. I made a minor change in the sentence display when you exit mmcheck and to exit mmcheck just requires pressing <enter> though a 0 still works.

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       : /home/james/bin/mmcheck
#: Date Created: Sun Oct 3 15:42:01 CDT 2010
#: Last Edit   : Thu Oct 28 19:19:15 CDT 2010
#: Author      : by RedDwarf & J. McDaniel
#: Version     : 1.20
#: Description : Check Your Installed Files for Mutimedia
#: Options     : none

# Written for the openSUSE forums on Thursday October 28, 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 Check Version 1.20 - Check for multimedia problems in just 13 steps "

#    "         1         2         3         4         5         6         7         8"
#    "12345678901234567890123456789012345678901234567890123456789012345678901234567890"

function rpm_verify {

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 "
}

# Determine program user, save home folder location, request root password

USER="$HOME"

# Menu Disply 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=1
# Starting Terminal Column Number for Menu
s_col=1

# Display Program Title
tput clear
tput cup $(( s_line )) $(( s_col ))
tput setf 7
tput setb 2
tput bold
echo "$1"

# 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 [0-"$maxnum"] or Just Press <enter> to Quit: " CHOICE
tput clear
tput sgr0
tput rc
return $CHOICE
}

#
# Main Program Loop starts here ...
#

while true ; do

# Setup Menu string Fields displayed for your menu

MENU="Mutimedia Test Selection - M E N U "
TOTL="13" 
TST1=" 1 . Check if there are any missing dependencies for installed packages ...     "
TST2=" 2 . Check if there are packages installed from the VideoLAN repository ...     "
TST3=" 3 . Check your basic installed multimedia packages ...                         "
TST4=" 4 . Verify you have xine installed and installed from Packman ...              "
TST5=" 5 . Check your xine packages (Anything with xine in its name is found)...      "
TST6=" 6 . Verify you have all the gstreamer plugins/codecs installed from Packman ..."
TST7=" 7 . Check your gstreamer packages ...                                          "
TST8=" 8 . Check your MPlayer package ...                                             "
TST9=" 9 . Check your VLC packages ...                                                "
TSTA=" 10. Check your w32codec package ...                                            "
TSTB=" 11. Verify your Quicktime Package is installed ...                             "
TSTC=" 12. Verify your Flash Packages are installed ...                               "
TSTD=" 13. Verify your Java Packages are Installed ...                                "

# 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"
CHOICE="$?"

# Execute User Command Here

case "$CHOICE" in

  "1") echo 
  tput bold
  tput setf 7
  tput setb 1
  echo "Before Checking Your Repositories, would you like "
  echo "to perform a Zypper Refresh right now? (Yes or No)"
  echo
  read -p "Enter your choice [y/N] " CHOICE
  if  "$CHOICE" == "y" ] ||  "$CHOICE" == "Y" ] ; then
    sudo zypper refresh
  fi
  echo
  tput bold
  tput setf 7
  tput setb 4
  echo $TST1
  echo
  tput setf 7
  tput setb 1
  tput bold
  echo "Command: LC_ALL=C zypper ve"
  tput sgr0
  echo
  LC_ALL=C zypper ve
  echo
  read -p "Press <enter> to continue..." ;;

  "2") echo 
  tput bold
  tput setf 7
  tput setb 4
  echo $TST2
  echo
  tput setf 7
  tput setb 1
  tput bold
  echo "Command: rpm -qa --queryformat '%{NAME} -> %{VENDOR}
' | grep -i VideoLAN"
  tput sgr0
  echo  
  rpm -qa --queryformat '%{NAME} -> %{VENDOR}
' | grep -i VideoLAN
  echo
  echo "Only libdvdcss should be installed from the VideoLAN repository."
  echo
  read -p "Press <enter> to continue..." ;;

  "3") echo 
  tput bold
  tput setf 7
  tput setb 4
  echo $TST3
  echo
  tput setf 7
  tput setb 1
  tput bold
  echo "Command: rpm --verify --query --all 'libav*' 'libpostproc*' 'libswscale*'"
  tput sgr0
  echo
  rpm --verify --query --all 'libav*' 'libpostproc*' 'libswscale*'
  echo
  rpm_verify
  echo
  read -p "Press <enter> to continue..." ;;

  "4") echo 
  tput bold
  tput setf 7
  tput setb 4
  echo $TST4
  echo
  tput setf 7
  tput setb 1
  tput bold
  echo "Command: rpm --query --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' libxine1 libxine1-codecs"
  tput sgr0
  echo
  rpm --query --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' libxine1 libxine1-codecs
  echo
  read -p "Press <enter> to continue..." ;;
 
  "5") echo 
  tput bold
  tput setf 7
  tput setb 4
  echo $TST5
  echo
  tput setf 7
  tput setb 1
  tput bold
  echo "Command: rpm --verify --query --all '*xine*'"
  tput sgr0
  echo
  rpm --verify --query --all '*xine*'
  echo
  rpm_verify
  echo
  read -p "Press <enter> to continue..." ;;

  "6") echo 
  tput bold
  tput setf 7
  tput setb 4
  echo $TST6
  echo 
  tput setf 7
  tput setb 1
  tput bold
  echo "Command: --query --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' 'gstreamer*'"
  tput sgr0
  echo
  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
  read -p "Press <enter> to continue..." ;;

  "7") echo 
  tput bold
  tput setf 7
  tput setb 4
  echo $TST7
  echo
  tput setf 7
  tput setb 1
  tput bold
  echo "Command: rpm --verify --query --all '*gst*'"
  tput sgr0
  echo
  rpm --verify --query --all '*gst*'
  echo
  rpm_verify
  echo
  read -p "Press <enter> to continue..." ;;

  "8") echo
  tput bold
  tput setf 7
  tput setb 4
  echo $TST8
  echo
  tput setf 7
  tput setb 1
  tput bold
  echo "Command:  rpm --verify MPlayer"
  tput sgr0
  echo
  rpm --verify MPlayer
  echo
  rpm_verify
  echo
  read -p "Press <enter> to continue..." ;;

  "9") echo 
  tput bold
  tput setf 7
  tput setb 4
  echo $TST9
  echo
  tput setf 7
  tput setb 1
  tput bold
  echo "Command: rpm --verify --query --all '*vlc*'"
  tput sgr0
  echo
  rpm --verify --query --all '*vlc*'
  echo
  rpm_verify
  echo
  read -p "Press <enter> to continue..." ;;

  "10") echo 
  tput bold
  tput setf 7
  tput setb 4
  echo $TSTA
  echo
  tput setf 7
  tput setb 1
  tput bold 
  echo "Command: rpm --verify w32codec-all"
  tput sgr0
  echo
  rpm --verify w32codec-all
  echo
  echo "Note that this package only adds support for some rare formats, and only"
  echo "works on 32bits systems.  On a x86-64 system it will not make any difference."
  echo
  rpm_verify
  echo
  read -p "Press <enter> to continue..." ;;

  "11") echo 
  tput bold
  tput setf 7
  tput setb 4
  echo $TSTB
  echo
  tput setf 7
  tput setb 1
  tput bold 
  echo "rpm --query --all --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' '*quicktime*'"
  tput sgr0
  echo
  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."
  echo
  read -p "Press <enter> to continue..." ;;

  "12") echo 
  tput bold
  tput setf 7
  tput setb 4
  echo $TSTC
  echo
  tput setf 7
  tput setb 1
  tput bold 
  echo "rpm --query --all --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' '*flash*'"
  tput sgr0
  echo
  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."
  echo
  read -p "Press <enter> to continue..." ;;

  "13") echo 
  tput bold
  tput setf 7
  tput setb 4
  echo $TSTD
  echo
  tput setf 7
  tput setb 1
  tput bold 
  echo "rpm --query --all --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' *java-*'"
  tput sgr0
  echo
  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."
  echo
  read -p "Press <enter> to continue..." ;;

  "0") echo 
  tput clear
  tput setf 7
  tput setb 4
  tput bold
  echo
  echo " To avoid package problems, the most important thing to do is to: **NEVER** "
  echo " ignore a dependency, even if YaST/zypper/updater gives you such an option! "
  echo " Change vendor is OK,  but ignoring dependencies is never a very good idea. "
  echo
  tput sgr0
  echo
  read -p "Press <enter> to exit mmcheck ..."
  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 

You can create an icon on your desktop to run mmcheck by doing the following tasks. Open a text editor and copy the following text in and then save the file as mmcheck.desktop in your home area Desktop folder (~/Desktop/mmcheck.desktop).

[Desktop Entry]
Comment[en_US]=
Comment=
Exec=~/bin/mmcheck
GenericName[en_US]=Multimedia Check - In 13 Steps
GenericName=Multimedia Check - In 13 Steps
Icon=video-television
MimeType=                                                                                                                                     
Name[en_US]=mmcheck                                                                                                                           
Name=mmcheck                                                                                                                                  
Path=
StartupNotify=true
Terminal=true
TerminalOptions=
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=none
X-KDE-SubstituteUID=false
X-KDE-Username=
X-SuSE-translate=true

Once saved in the right place with the correct name an icon should appears on your desktop called mmcheck. I picked an icon of a monitor, but you could change it to anything you wanted.

Thank You,

That’s really cool James! I’m sure it will help a lot of people that are new to openSUSE and somewhat confused by the multimedia situation (I know I was lol!). I’m going to translate your post and post it as a sticky in the French forum.

oysterboy That’s really cool James! I’m sure it will help a lot of people that are new to openSUSE and somewhat confused by the multimedia situation (I know I was lol!). I’m going to translate your post and post it as a sticky in the French forum.
oysterboy I really appreciate your support! Obviously I am no good at French, if you want to translate the whole thing you are welcome to do so. Also, if you need help in placing any modifications into the program, I can help there as well. I would need some sort of before and after for each line.

Of course, you are welcome to do anything you want or can do. I really do think this script can help a lot of people with their multimedia problems. It would be better if one could just download a working script perhaps, but I was also hoping that others would use and modify the script as well. Anyway. Good luck and thanks so much for your support.

Thank You,

Hi James,

Im new to using any linux systems. I have installed OpenSUSE 11.3_x64. i was facing problems with the audio…so when i googled the issue i jst chanced upon ur posts…

rite nw i can hear the audio from webpages as a result of the test 1 from ur script…
the other test results im not able to decipher if anything is wrong…requesting ur help…!!

the following are the test results-

                                                                            *

**3 . Check your basic installed multimedia packages … **

If everything verified properly there will be no output. If there are any
discrepancies they will be displayed. The format of the output is a string
of 8 characters, a possible c denoting a configuration file, and then
the file name. Each of the 8 characters denotes the result of a comparison
of one attribute of the file to the value of that attribute recorded in the
RPM database. A single . (period) means the test passed. The following
characters denote failure of certain tests:

 5 -- MD5 checksum                                                          
 S -- File size                                                             
 L -- Symbolic link                                                         
 T -- File modification time                                                
 D -- Device                                                                
 U -- User                                                                  
 G -- Group                                                                 
 M -- Mode (includes permissions and file type)                             
 ? -- Unreadable file                                                       
                                                                            *

***4 . Verify you have xine installed and installed from Packman … **

libxine1-1.1.19-1.pm.44.6-x86_64 -> PackMan :: Startseite
libxine1-codecs-1.1.19-1.pm.44.6-x86_64 -> PackMan :: Startseite

**5 . Check your xine packages (Anything with xine in its name is found)… **

If everything verified properly there will be no output. If there are any
discrepancies they will be displayed. The format of the output is a string
of 8 characters, a possible c denoting a configuration file, and then
the file name. Each of the 8 characters denotes the result of a comparison
of one attribute of the file to the value of that attribute recorded in the
RPM database. A single . (period) means the test passed. The following
characters denote failure of certain tests:

 5 -- MD5 checksum                                                          
 S -- File size                                                             
 L -- Symbolic link                                                         
 T -- File modification time                                                
 D -- Device                                                                
 U -- User                                                                  
 G -- Group                                                                 
 M -- Mode (includes permissions and file type)                             
 ? -- Unreadable file                                                       

**6 . Verify you have all the gstreamer plugins/codecs installed from Packman … **

package gstreamer-0_10-ffmpeg is not installed
gstreamer-0_10-fluendo-mp3-2-106.2-x86_64 -> openSUSE
package gstreamer-0_10-fluendo-mpegdemux is not installed
package gstreamer-0_10-fluendo-mpegmux is not installed
package gstreamer-0_10-plugins-bad is not installed
gstreamer-0_10-plugins-base-0.10.29-1.9-x86_64 -> openSUSE
package gstreamer-0_10-plugins-good is not installed
package gstreamer-0_10-plugins-good-extra is not installed
package gstreamer-0_10-plugins-ugly is not installed

**7 . Check your gstreamer packages … **

If everything verified properly there will be no output. If there are any
discrepancies they will be displayed. The format of the output is a string
of 8 characters, a possible c denoting a configuration file, and then
the file name. Each of the 8 characters denotes the result of a comparison
of one attribute of the file to the value of that attribute recorded in the
RPM database. A single . (period) means the test passed. The following
characters denote failure of certain tests:

 5 -- MD5 checksum                                                          
 S -- File size                                                             
 L -- Symbolic link                                                         
 T -- File modification time                                                
 D -- Device                                                                
 U -- User                                                                  
 G -- Group                                                                 
 M -- Mode (includes permissions and file type)                             
 ? -- Unreadable file                                                       

**8 . Check your MPlayer package … **

package MPlayer is not installed

If everything verified properly there will be no output. If there are any
discrepancies they will be displayed. The format of the output is a string
of 8 characters, a possible c denoting a configuration file, and then
the file name. Each of the 8 characters denotes the result of a comparison
of one attribute of the file to the value of that attribute recorded in the
RPM database. A single . (period) means the test passed. The following
characters denote failure of certain tests:

 5 -- MD5 checksum                                                          
 S -- File size                                                             
 L -- Symbolic link                                                         
 T -- File modification time                                                
 D -- Device                                                                
 U -- User                                                                  
 G -- Group                                                                 
 M -- Mode (includes permissions and file type)                             
 ? -- Unreadable file                                                       

**9 . Check your VLC packages … **

If everything verified properly there will be no output. If there are any
discrepancies they will be displayed. The format of the output is a string
of 8 characters, a possible c denoting a configuration file, and then
the file name. Each of the 8 characters denotes the result of a comparison
of one attribute of the file to the value of that attribute recorded in the
RPM database. A single . (period) means the test passed. The following
characters denote failure of certain tests:

 5 -- MD5 checksum                                                          
 S -- File size                                                             
 L -- Symbolic link                                                         
 T -- File modification time                                                
 D -- Device                                                                
 U -- User                                                                  
 G -- Group                                                                 
 M -- Mode (includes permissions and file type)                             
 ? -- Unreadable file                                                       

**10. Check your w32codec package … **

Note that this package only adds support for some rare formats, and only
works on 32bits systems. On a x86-64 system it will not make any difference.

If everything verified properly there will be no output. If there are any
discrepancies they will be displayed. The format of the output is a string
of 8 characters, a possible c denoting a configuration file, and then
the file name. Each of the 8 characters denotes the result of a comparison
of one attribute of the file to the value of that attribute recorded in the
RPM database. A single . (period) means the test passed. The following
characters denote failure of certain tests:

 5 -- MD5 checksum                                                          
 S -- File size                                                             
 L -- Symbolic link                                                         
 T -- File modification time                                                
 D -- Device                                                                
 U -- User                                                                  
 G -- Group                                                                 
 M -- Mode (includes permissions and file type)                             
 ? -- Unreadable file                                                       

**11. Verify your Quicktime Package is installed … **

libquicktime-1.1.5-3.2-x86_64 -> openSUSE

You should expect to have only one Quicktime Package Installed
called ----> libquicktime0 <---- from the Packman Repository.

**12. Verify your Flash Packages are installed … **

flash-plugin-10.1.85.3-release-i386 -> Adobe Systems Inc.
flash-player-10.1.53.64-1.1-i586 -> openSUSE
pullin-flash-player-11.3-1.2-x86_64 -> openSUSE

You should expect to have only two Flash Packages Installed which will be
----------------> pullin-flash-player <---- from the openSUSE Repository.
----------------> flash-player <----------- from the openSUSE Repository.

**13. Verify your Java Packages are Installed … **

java-ca-certificates-1-5.3-noarch -> openSUSE
java-1_6_0-openjdk-1.6.0.0_b17-7.3-x86_64 -> openSUSE
java-1_6_0-openjdk-plugin-1.6.0.0_b17-7.3-x86_64 -> openSUSE

You should expect to have only Sun Java Packages installed. If your files
include the name → openjdk <–, it is suggested that they be uninstalled.
*
Thanks in advance for ur help…!! :slight_smile:

Hi… you might want to try this. Worked for me.

Restricted formats/11.3 - openSUSE Community Wiki

I originally did the one click install but for what ever reason it didn’t fully work.

I retried with the code option and solved my problems re: ripping cds to MP3.

I am linux newbe though.

Hello James,

You may want to update your script now that libdvdcss seems to be available directly from Packman (so no need at all to include any package from Videolan).

By the way, where does the advice about replacing openjdk with Sun’s Java come from? Is it still valid?

Thanks again!

Hello jesu_3j. You don’t show outputs from 1 & 2, so I assume they are good. All items in bold are wrong and need attention.

  1. No output from a rpm verify command is good.
  2. You show the correct two outputs from the right place. This is good.
  3. No output from a rpm verify command is good.
    **
    6 . Verify you have all the gstreamer plugins/codecs installed from Packman … ***

**package gstreamer-0_10-ffmpeg is not installed **
***gstreamer-0_10-fluendo-mp3-2-106.2-x86_64 -> openSUSE ****package gstreamer-0_10-fluendo-mpegdemux is not installed ****package gstreamer-0_10-fluendo-mpegmux is not installed ****package gstreamer-0_10-plugins-bad is not installed ****gstreamer-0_10-plugins-base-0.10.29-1.9-x86_64 -> openSUSE ****package gstreamer-0_10-plugins-good is not installed ****package gstreamer-0_10-plugins-good-extra is not installed ****package gstreamer-0_10-plugins-ugly is not installed **

Your Gstreamer files are either not installed or installed from the wrong repository. You need to search on each package, make sure that Packman repository is set and replace or install all packages shown above.

7. No output from a rpm verify command is normally good but you don’t have the right programs installed, so that is bad.
**8. ****The package MPlayer is not installed, this is bad.
**9. No output from a rpm verify command is good.
10. No output from a rpm verify command is good.
11. You have the correct program installed. This is good.
**12. You need to uninstall this: **flash-plugin-10.1.85.3-release-i386 -> Adobe Systems Inc.
13. All three programs are wrong. Uninstall all of them and install these:

java-1_6_0-sun-1.6.0.u22-1.2.1-x86_64 -> openSUSE
java-1_6_0-sun-alsa-1.6.0.u22-1.2.1-x86_64 -> openSUSE
java-1_6_0-sun-plugin-1.6.0.u22-1.2.1-x86_64 -> openSUSE

Also, waveheadwales suggest you read the following link information. That is a good idea.

Restricted formats/11.3 - openSUSE Community Wiki

Thank You,

Hello James,

You may want to update your script now that libdvdcss seems to be available directly from Packman (so no need at all to include any package from Videolan).

By the way, where does the advice about replacing openjdk with Sun’s Java come from? Is it still valid?

Thanks again!
This is the first I heard about the libdvdcss being downloadable from Packman. I will check it out.

The openjdk files simple do not provide total compatibility with present flash web pages and very often fails. As long as Sun Java is present, this is my recommendation to use it instead of openjdk. This is not based on any directive, but rather experience here online.

Thank You,

Well, just on the heels of releasing a new version yesterday, it would seem that Packman has gone and released libdvdcss2, thus making adding in the VideoLAN repository no longer necessary to obtain the ability to view DVD movies. In light of this sudden change, I have released mmcheck version 1.22 with a 14th option for looking at libdvdcss installed files and verbage suggesting to obtain this file from Packman and to remove it from VideoLAN.

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       : /home/james/bin/mmcheck
#: Date Created: Sun Oct 3 15:42:01 CDT 2010
#: Last Edit   : Thu Oct 29 20:13:10 CDT 2010
#: Author      : by RedDwarf & J. McDaniel
#: Version     : 1.22
#: Description : Check Your Installed Files for Mutimedia
#: Options     : none

# Written for the openSUSE forums on Friday October 29, 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 Check Version 1.22 - Check for multimedia problems in just 14 steps "

function rpm_verify {

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 "
}

# Determine program user, save home folder location

USER="$HOME"

# Menu Disply 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

# Display Program Title
tput clear
tput cup $(( s_line )) $(( s_col ))
tput setf 7
tput setb 2
tput bold
echo "$1"

# 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: " CHOICE
tput clear
tput sgr0
tput rc
return $CHOICE
}

#
# Main Program Loop starts here ...
#

while true ; do

# Setup Menu string Fields displayed for your menu

MENU="Mutimedia Test Selection - M E N U "
TOTL="14" 
TST1=" 1 . Check if there are any missing dependencies for installed packages ...     "
TST2=" 2 . Check for any packages installed from the VideoLAN repository ...          "
TST3=" 3 . Check your basic installed multimedia packages ...                         "
TST4=" 4 . Verify you have xine installed and installed from Packman ...              "
TST5=" 5 . Check your xine packages (Anything with xine in its name is found)...      "
TST6=" 6 . Verify you have all the gstreamer plugins/codecs installed from Packman ..."
TST7=" 7 . Check your gstreamer packages ...                                          "
TST8=" 8 . Check your MPlayer package ...                                             "
TST9=" 9 . Check your VLC packages ...                                                "
TSTA=" 10. Check your w32codec package ...                                            "
TSTB=" 11. Verify your Quicktime Package is installed for Internet Browsing ...       "
TSTC=" 12. Verify your Flash Packages are installed for Internet Browsing ...         "
TSTD=" 13. Verify your Java Packages are Installed for Internet Browsing ...          "
TSTE=" 14. Verify your libdvdcss Package is Installed from Packman for DVD movies ... "

# 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"
CHOICE="$?"

# Execute User Command Here

case "$CHOICE" in

  "1") echo 
  tput bold
  tput setf 7
  tput setb 1
  echo "Before Checking Your Repositories, would you like "
  echo "to perform a Zypper Refresh right now? (Yes or No)"
  echo
  read -p "Enter your choice [y/N] " CHOICE
  if  "$CHOICE" == "y" ] ||  "$CHOICE" == "Y" ] ; then
    sudo zypper refresh
  fi
  echo
  tput bold
  tput setf 7
  tput setb 4
  echo $TST1
  echo
  tput setf 7
  tput setb 1
  tput bold
  echo "Command: LC_ALL=C zypper ve"
  tput sgr0
  echo
  LC_ALL=C zypper ve
  echo
  read -p "Press <enter> to continue..." ;;

  "2") echo 
  tput bold
  tput setf 7
  tput setb 4
  echo $TST2
  echo
  tput setf 7
  tput setb 1
  tput bold
  echo "Command: rpm -qa --queryformat '%{NAME} -> %{VENDOR}
' | grep -i VideoLAN"
  tput sgr0
  echo  
  rpm -qa --queryformat '%{NAME} -> %{VENDOR}
' | grep -i VideoLAN
  echo
  echo "If you have installed libdvdcss2 from Packman, 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 Packman and to remove the VideoLAN Repository.     "
  echo
  read -p "Press <enter> to continue..." ;;

  "3") echo 
  tput bold
  tput setf 7
  tput setb 4
  echo $TST3
  echo
  tput setf 7
  tput setb 1
  tput bold
  echo "Command: rpm --verify --query --all 'libav*' 'libpostproc*' 'libswscale*'"
  tput sgr0
  echo
  rpm --verify --query --all 'libav*' 'libpostproc*' 'libswscale*'
  echo
  rpm_verify
  echo
  read -p "Press <enter> to continue..." ;;

  "4") echo 
  tput bold
  tput setf 7
  tput setb 4
  echo $TST4
  echo
  tput setf 7
  tput setb 1
  tput bold
  echo "Command: rpm --query --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' libxine1 libxine1-codecs"
  tput sgr0
  echo
  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."
  echo
  read -p "Press <enter> to continue..." ;;
 
  "5") echo 
  tput bold
  tput setf 7
  tput setb 4
  echo $TST5
  echo
  tput setf 7
  tput setb 1
  tput bold
  echo "Command: rpm --verify --query --all '*xine*'"
  tput sgr0
  echo
  rpm --verify --query --all '*xine*'
  echo
  rpm_verify
  echo
  read -p "Press <enter> to continue..." ;;

  "6") echo 
  tput bold
  tput setf 7
  tput setb 4
  echo $TST6
  echo 
  tput setf 7
  tput setb 1
  tput bold
  echo "Command: --query --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' 'gstreamer*'"
  tput sgr0
  echo
  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."
  echo
  read -p "Press <enter> to continue..." ;;

  "7") echo 
  tput bold
  tput setf 7
  tput setb 4
  echo $TST7
  echo
  tput setf 7
  tput setb 1
  tput bold
  echo "Command: rpm --verify --query --all '*gst*'"
  tput sgr0
  echo
  rpm --verify --query --all '*gst*'
  echo
  rpm_verify
  echo
  read -p "Press <enter> to continue..." ;;

  "8") echo
  tput bold
  tput setf 7
  tput setb 4
  echo $TST8
  echo
  tput setf 7
  tput setb 1
  tput bold
  echo "Command:  rpm --verify MPlayer"
  tput sgr0
  echo
  rpm --verify MPlayer
  echo
  rpm_verify
  echo
  read -p "Press <enter> to continue..." ;;

  "9") echo 
  tput bold
  tput setf 7
  tput setb 4
  echo $TST9
  echo
  tput setf 7
  tput setb 1
  tput bold
  echo "Command: rpm --verify --query --all '*vlc*'"
  tput sgr0
  echo
  rpm --verify --query --all '*vlc*'
  echo
  rpm_verify
  echo
  read -p "Press <enter> to continue..." ;;

  "10") echo 
  tput bold
  tput setf 7
  tput setb 4
  echo $TSTA
  echo
  tput setf 7
  tput setb 1
  tput bold 
  echo "Command: rpm --verify w32codec-all"
  tput sgr0
  echo
  rpm --verify w32codec-all
  echo
  echo "Note that this package only adds support for some rare formats, and only"
  echo "works on 32bits systems.  On a x86-64 system it will not make any difference."
  echo
  rpm_verify
  echo
  read -p "Press <enter> to continue..." ;;

  "11") echo 
  tput bold
  tput setf 7
  tput setb 4
  echo $TSTB
  echo
  tput setf 7
  tput setb 1
  tput bold 
  echo "rpm --query --all --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' '*quicktime*'"
  tput sgr0
  echo
  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."
  echo
  read -p "Press <enter> to continue..." ;;

  "12") echo 
  tput bold
  tput setf 7
  tput setb 4
  echo $TSTC
  echo
  tput setf 7
  tput setb 1
  tput bold 
  echo "rpm --query --all --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' '*flash*'"
  tput sgr0
  echo
  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."
  echo
  read -p "Press <enter> to continue..." ;;

  "13") echo 
  tput bold
  tput setf 7
  tput setb 4
  echo $TSTD
  echo
  tput setf 7
  tput setb 1
  tput bold 
  echo "rpm --query --all --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' '*java-*'"
  tput sgr0
  echo
  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."
  echo
  read -p "Press <enter> to continue..." ;;

  "14") echo 
  tput bold
  tput setf 7
  tput setb 4
  echo $TSTE
  echo
  tput setf 7
  tput setb 1
  tput bold 
  echo "rpm --query --all --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' '*libdvdcss*'"
  tput sgr0
  echo
  rpm --query --all --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' '*libdvdcss*'
  echo
  echo "You need at least one libdvdcss or libdvdcss2 file installed here. Packman"
  echo "is the prefered vendor but the file does work if obtained from VideoLAN."
  echo "You should consider changing to Packman from VideoLAN if you have not "
  echo "already done so.  You do not need to have both packages installed and "
  echo "it is suggested that you remove VideoLAN's package and its repository."
  echo
  read -p "Press <enter> to continue..." ;;

  "0") echo 
  tput clear
  tput setf 7
  tput setb 4
  tput bold
  echo
  echo " To avoid package problems, the most important thing to do is to: **NEVER** "
  echo " ignore a dependency, even if YaST/zypper/updater gives you such an option! "
  echo " Change vendor is OK,  but ignoring dependencies is never a very good idea. "
  echo
  tput sgr0
  echo
  read -p "Press <enter> to exit mmcheck ..."
  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 

You can create an icon on your desktop to run mmcheck by doing the following tasks. Open a text editor and copy the following text in and then save the file as mmcheck.desktop in your home area Desktop folder (~/Desktop/mmcheck.desktop).

[Desktop Entry]
Comment[en_US]=
Comment=
Exec=~/bin/mmcheck
GenericName[en_US]=Multimedia Check - In 14 Steps
GenericName=Multimedia Check - In 14 Steps
Icon=video-television
MimeType=                                                                                                                                     
Name[en_US]=mmcheck                                                                                                                           
Name=mmcheck                                                                                                                                  
Path=
StartupNotify=true
Terminal=true
TerminalOptions=
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=none
X-KDE-SubstituteUID=false
X-KDE-Username=
X-SuSE-translate=true

Once saved in the right place with the correct name an icon should appears on your desktop called mmcheck. I picked an icon of a monitor, but you could change it to anything you wanted.

Thank You,

Well now we know that Packman releasing libdvdcss was a mistake - it’s not available there anymore. On the other hand, I learned that the following repo distributes libdvdcss and only libdvdcss : http://opensuse-guide.org/repo/11.3. So your advice about Videolan being useless is still valid, provided the user adds this alternative libdvdcss repo (which I assume we can trust).

Hello oysterboy, it looks like you can’t act quickly on some changes, but perhaps wait until they really become permanent. I guess I will have to release yet one more version of mmcheck because of the libdvdcss issue, if I could really believe what the correct situation is.

Thank You,

Just a suggestion. You have many groups of tputs which are the same. You could reduce the verbosity of your script by making shell functions of frequently used tputs sequences.

I have made yet more modifications to mmcheck with version 1.30. First off, the suggestions to use Packman for the libdvdcss has been removed and the new location of libdvdcss for openSUSE 11.3 has been added. Next, I have added option 15 to list all of your repositories. Finally, per ken_yap suggestion, I have condensed the many color calls into one function which reduces the overall character count. I might add though, that with the exception of the text size limits in the forums to post your threads, there is no real penalty to having a long script as long as it works. So, here we go…

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   : Tue Nov 2 17:33:10 CDT 2010
#: Author      : J. McDaniel
#: Version     : 1.30
#: Description : Check Your Installed Files for Mutimedia
#: Options     : none

# Written for the openSUSE forums on Tuesday November 2, 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 Check Version 1.30 - Check for multimedia problems in just 15 steps "

#    "         1         2         3         4         5         6         7         8"
#    "12345678901234567890123456789012345678901234567890123456789012345678901234567890"

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 "
}

# Determine program user, save home folder location

USER="$HOME"

# Menu Disply 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

# Display Program Title
tput clear
tput cup $(( s_line )) $(( s_col ))
tput setf 7
tput setb 2
tput bold
echo "$1"

# 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 forground 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="Mutimedia Test Selection - M E N U "
TOTL="15" 
TST1=" 1 . Check if there are any missing dependencies for installed packages ...     "
TST2=" 2 . Check for any packages installed from the VideoLAN repository ...          "
TST3=" 3 . Check your basic installed multimedia packages ...                         "
TST4=" 4 . Verify you have xine installed and installed from Packman ...              "
TST5=" 5 . Check your xine packages (Anything with xine in its name is found)...      "
TST6=" 6 . Verify you have all the gstreamer plugins/codecs installed from Packman ..."
TST7=" 7 . Check your gstreamer packages ...                                          "
TST8=" 8 . Check your MPlayer package ...                                             "
TST9=" 9 . Check your VLC packages ...                                                "
TSTA=" 10. Check your w32codec package ...                                            "
TSTB=" 11. Verify your Quicktime Package is installed for Internet Browsing ...       "
TSTC=" 12. Verify your Flash Packages are installed for Internet Browsing ...         "
TSTD=" 13. Verify your Java Packages are Installed for Internet Browsing ...          "
TSTE=" 14. Verify your libdvdcss Package is Installed for DVD movies ...              "
TSTF=" 15. List All openSUSE Repositories as entered in your Computer ...             "

# 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: rpm -qa --queryformat '%{NAME} -> %{VENDOR}
' | grep -i VideoLAN"
  rpm -qa --queryformat '%{NAME} -> %{VENDOR}
' | grep -i VideoLAN
  libdvd_warn
  press_enter ;;

  "3") 
  print_color 7 4 1 "$TST3"
  print_color 7 1 1 "Command: rpm --verify --query --all 'libav*' 'libpostproc*' 'libswscale*'"
  rpm --verify --query --all 'libav*' 'libpostproc*' 'libswscale*'
  rpm_verify
  press_enter ;;

  "4")  
  print_color 7 4 1 "$TST4"
  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 ;;
 
  "5")  
  print_color 7 4 1 "$TST5"
  print_color 7 1 1 "Command: rpm --verify --query --all '*xine*'"
  rpm --verify --query --all '*xine*'
  rpm_verify
  press_enter ;;

  "6")  
  print_color 7 4 1 "$TST6"
  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 ;;

  "7")  
  print_color 7 4 1 "$TST7"
  print_color 7 1 1 "Command: rpm --verify --query --all '*gst*'"
  rpm --verify --query --all '*gst*'
  rpm_verify
  press_enter ;;

  "8") 
  print_color 7 4 1 "$TST8"
  print_color 7 1 1 "Command:  rpm --verify MPlayer"
  rpm --verify MPlayer
  rpm_verify
  press_enter ;;

  "9") 
  print_color 7 4 1 "$TST9"
  print_color 7 1 1 "Command: rpm --verify --query --all '*vlc*'"
  rpm --verify --query --all '*vlc*'
  rpm_verify
  press_enter ;;

  "10")  
  print_color 7 4 1 "$TSTA"
  print_color 7 1 1 "Command: rpm --verify w32codec-all"
  rpm --verify w32codec-all
  echo
  echo "Note that this package only adds support for some rare formats, and only"
  echo "works on 32bits systems.  On a x86-64 system it will not make any difference."
  rpm_verify
  press_enter ;;

  "11")  
  print_color 7 4 1 "$TSTB"
  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 ;;

  "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 --query --all --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' '*libdvdcss*'"
  rpm --query --all --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH} -> %{VENDOR}
' '*libdvdcss*'
  libdvd_warn
  press_enter ;;

  "15")
  print_color 7 4 1 "$TSTF"
  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 ;;

  "0") echo 
  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

You can create an icon on your desktop to run mmcheck by doing the following tasks. Open a text editor and copy the following text in and then save the file as mmcheck.desktop in your home area Desktop folder (~/Desktop/mmcheck.desktop).

[Desktop Entry]
Comment[en_US]=
Comment=
Exec=~/bin/mmcheck
GenericName[en_US]=Multimedia Check - In 15 Steps
GenericName=Multimedia Check - In 15 Steps
Icon=video-television
MimeType=                                                                                                     Name[en_US]=mmcheck                                                                                   Name=mmcheck                                                                                              Path=
StartupNotify=true
Terminal=true
TerminalOptions=
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=none
X-KDE-SubstituteUID=false
X-KDE-Username=
X-SuSE-translate=true

Once saved in the right place with the correct name an icon should appears on your desktop called mmcheck. I picked an icon of a monitor, but you could change it to anything you wanted.

Thank You,

Collecting common operations into subroutines is not a matter of reducing character count. Among other things, it allows you to change things in one place, e.g. if you decide to make the highlight green instead of blue or whatever, you don’t have to change every place it appears in the code.

Collecting common operations into subroutines is not a matter of reducing character count. Among other things, it allows you to change things in one place, e.g. if you decide to make the highlight green instead of blue or whatever, you don’t have to change every place it appears in the code.
ken_yap, you are absolutely correct and I am not complaining in any way. Further, surely using functions would simplify your script in many ways. My only thought is I am trying to get to some end means and working properly is my number one goal. General good programming habits should be used for all aspects of your script, but if your knowledge is lacking and the script is for personnel use, I don’t lose sleep over best practices not always being followed.

Thank You,