#!/bin/bash FAIL_COUNTER=0 check_pkg() { local pkg=$1 if rpm -q $pkg then echo "PASS" else echo "FAIL" let "FAIL_COUNTER=FAIL_COUNTER+1" fi } check_pkg "ibus" check_pkg "ibus-table" check_pkg "ibus-table-code" check_pkg "ibus-table-cyrillic" check_pkg "ibus-table-latin" check_pkg "ibus-table-translit" check_pkg "ibus-table-tv" check_pkg "ibus-table-mathwriter" echo "starting ibus-daemon." ibus-daemon -v -r -d if [ $? == 0 ] then echo "PASS" else echo "FAIL" let "FAIL_COUNTER=FAIL_COUNTER+1" fi echo "give ibus-daemon some time to start properly." sleep 5 for name in \ cns11643 \ emoji-table \ latex \ rusle \ rustrad \ yawerty \ compose \ hu-old-hungarian-rovas \ ipa-x-sampa \ translit-ua \ translit \ telex \ thai \ viqr \ vni \ mathwriter-ibus do echo "checking whether ibus can list ${name}:" ibus list-engine --name-only | grep "table:${name}" if [ $? == 0 ] then echo "PASS" else echo "FAIL" let "FAIL_COUNTER=FAIL_COUNTER+1" fi done exit ${FAIL_COUNTER}