alsa-info: Use pgrep with -f for matching against the process' cmdline.
PATCH 1/1 alsa-info: Use pgrep with -f for matching against the process' cmdline.
Latest alsa-info.sh has a sound daemon detection snippet which uses pgrep to find out if any sound daemon is loaded or not. The full paths to the binaries are given to pgrep but pgrep matches its first parameter against the "process name" by default.
Call pgrep with -f to match against the process' command line to fix the detection code.
Signed-off-by Ozan Çağlayan <[email protected]>
--- utils/alsa-info.sh | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
utils/alsa-info.sh +3 -3
@@ -375,21 +375,21 @@ echo "!!Sound Servers on this system" >> $FILE echo "!!----------------------------" >> $FILE echo "" >> $FILE if [[ -n $PAINST ]];then -[[ `pgrep $PAINST` ]] && PARUNNING="Yes" || PARUNNING="No" +[[ `pgrep -f $PAINST` ]] && PARUNNING="Yes" || PARUNNING="No" echo "Pulseaudio:" >> $FILE echo " Installed - Yes ($PAINST)" >> $FILE echo " Running - $PARUNNING" >> $FILE echo "" >> $FILE fi if [[ -n $ESDINST ]];then -[[ `pgrep $ESDINST` ]] && ESDRUNNING="Yes" || ESDRUNNING="No" +[[ `pgrep -f $ESDINST` ]] && ESDRUNNING="Yes" || ESDRUNNING="No" echo "ESound Daemon:" >> $FILE echo " Installed - Yes ($ESDINST)" >> $FILE echo " Running - $ESDRUNNING" >> $FILE echo "" >> $FILE fi if [[ -n $ARTSINST ]];then -[[ `pgrep $ARTSINST` ]] && ARTSRUNNING="Yes" || ARTSRUNNING="No" +[[ `pgrep -f $ARTSINST` ]] && ARTSRUNNING="Yes" || ARTSRUNNING="No" echo "aRts:" >> $FILE echo " Installed - Yes ($ARTSINST)" >> $FILE echo " Running - $ARTSRUNNING" >> $FILE
Signature · 6 lines
1.6.1 _______________________________________________ Alsa-devel mailing list [email protected] http://mailman.alsa-project.org/mailman/listinfo/alsa-devel