Add usage info to plymouth-set-default-plugin

This commit is contained in:
Ray Strode 2008-11-19 10:40:40 -05:00
parent 6222e35e08
commit 02ea84e6d3

View file

@ -14,6 +14,11 @@ fi
[ -z "$LIBDIR" ] && LIBDIR="/usr/$LIB"
[ -z "$BINDIR" ] && BINDIR="/usr/bin"
function usage ()
{
echo "usage: plymouth-set-default-plugin { --reset | <plugin-name> }"
}
if [ $# -lt 1 ]; then
PLUGIN_NAME=$(basename $(readlink ${LIBDIR}/plymouth/default.so) .so)
if [ -z "$PLUGIN_NAME" ]; then
@ -29,6 +34,11 @@ if [ `id -u` -ne 0 ]; then
exit 1
fi
if [ $# -ne 1 ]; then
echo $(usage) > /dev/stderr
exit 1
fi
PLUGIN_NAME=$1
if [ $1 = '--reset' ]; then
PLUGIN_NAME=$(basename $(ls -1 -t ${LIBDIR}/plymouth/*.so 2> /dev/null | grep -v default.so | tail -n 1) .so)