diff options
author | Ray Strode <rstrode@redhat.com> | 2008-06-11 10:58:10 -0400 |
---|---|---|
committer | Ray Strode <rstrode@redhat.com> | 2008-06-11 12:10:22 -0400 |
commit | 9e37acbd1339463d968b8b144bb210ca905ad309 (patch) | |
tree | 07ef832ecded7ad3f17738f9027eda61593abfb2 /scripts | |
parent | e86a9268dc2a0a429d5ba2e1fd775f36f84646d9 (diff) | |
download | plymouth-9e37acbd1339463d968b8b144bb210ca905ad309.tar.gz plymouth-9e37acbd1339463d968b8b144bb210ca905ad309.tar.xz plymouth-9e37acbd1339463d968b8b144bb210ca905ad309.zip |
Add --reset argument to set-default-plugin
It just chooses the last installed plugin as the default
or no plugin if there is none available
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/plymouth-set-default-plugin | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/scripts/plymouth-set-default-plugin b/scripts/plymouth-set-default-plugin index 42a0266..a4f0616 100755 --- a/scripts/plymouth-set-default-plugin +++ b/scripts/plymouth-set-default-plugin @@ -18,10 +18,19 @@ if [ `id -u` -ne 0 ]; then exit 1 fi -if [ ! -e ${LIBDIR}/plymouth/$1.so ]; then - echo "${LIBDIR}/plymouth/$1.so does not exist" > /dev/stderr +PLUGIN_NAME=$1 +if [ $1 = '--reset' ]; then + PLUGIN_NAME=$(basename $(ls -1 -t ${LIBDIR}/plymouth/*.so 2> /dev/null | grep -v graphical.so | head -n 1) .so) + if [ $PLUGIN_NAME = .so ]; then + rm -f ${LIBDIR}/plymouth/graphical.so + exit 0 + fi +fi + +if [ ! -e ${LIBDIR}/plymouth/${PLUGIN_NAME}.so ]; then + echo "${LIBDIR}/plymouth/${PLUGIN_NAME}.so does not exist" > /dev/stderr exit 1 fi -(cd ${LIBDIR}/plymouth; ln -sf $1 graphical.so) +(cd ${LIBDIR}/plymouth; ln -sf ${PLUGIN_NAME}.so graphical.so) |