ukui-biometric-auth/pam-biometric/utils/biodrvctl

43 lines
781 B
Bash
Executable File

#!/bin/bash
export TEXTDOMAINDIR=/usr/share/locale
export TEXTDOMAIN=biodrvctl
. gettext.sh
function usage()
{
echo "Usage:"
echo " biodrvctl "$(gettext "COMMAND DRIVER-NAME")
echo
echo "Build-in command:"
echo " enable "$(gettext "Enable device's driver")
echo " disable "$(gettext "Disable device's driver")
}
if [ $# -ne 2 ]; then
usage
exit 1
fi
if [ `whoami` != 'root' ]; then
echo $(gettext "Permission denied, please run by root")
exit 1
fi
if [ "$1" == "enable" ]; then
biometric-config-tool enable-driver $2
elif [ "$1" == "disable" ]; then
biometric-config-tool disable-driver $2
else
usage
exit 1
fi
if [ $? -eq 0 ]; then
systemctl reset-failed biometric-authentication.service
systemctl restart biometric-authentication.service
fi
exit $?