diff options
Diffstat (limited to 'scripts/switch-themes')
-rwxr-xr-x | scripts/switch-themes | 40 |
1 files changed, 31 insertions, 9 deletions
diff --git a/scripts/switch-themes b/scripts/switch-themes index 3492e09..273044c 100755 --- a/scripts/switch-themes +++ b/scripts/switch-themes @@ -40,23 +40,22 @@ function lilo_switch_themes () { if [[ ! -f $message_from_theme ]];then return; fi - if [[ ! -e $bootdir/lilo ]];then + if [[ ! -e $bootdir/message ]];then return; fi #Make sure to point on lilo-graphic - if [[ -L $bootdir/lilo ]];then - point_to=$(read_link $bootdir/lilo) + if [[ -L $bootdir/message ]];then + point_to=$(read_link $bootdir/message) if [[ $point_to != lilo-graphic ]];then - rm -f $bootdir/lilo - ln -s lilo-graphic $bootdir/lilo + rm -f $bootdir/message + ln -s lilo-graphic $bootdir/message fi fi if ! cmp -s $message_from_theme $message_from_current;then cp -f $message_from_theme $message_from_current fi - } function check_it () { @@ -89,6 +88,11 @@ function switch_theme () { tmpfile=$(mktemp /tmp/.bootsplash.XXXXXXX) cp -f $sysconfig $tmpfile && rm -f $sysconfig while read line;do + if [[ $line == SPLASH=* ]];then + echo "SPLASH=auto" >> $sysconfig + ok=yes + continue; + fi if [[ $line == THEME=* ]];then echo "THEME=$toswitch" >> $sysconfig ok=yes @@ -100,13 +104,30 @@ function switch_theme () { echo "THEME=$toswitch" >> $sysconfig fi rm -f $tmpfile - if [[ -d /etc/bootsplash/$toswitch ]]; then - rm -f /etc/bootsplash/current - ln -s /etc/bootsplash/$toswitch current + if [[ -d /etc/bootsplash/themes/$toswitch ]]; then + rm -f /etc/bootsplash/themes/current + ln -s /etc/bootsplash/themes/$toswitch current fi fi } +function update_boot () { + pushd /boot &> /dev/null + if [[ -x /usr/share/loader/make-initrd ]]; then + /usr/share/loader/make-initrd -n &> /dev/null + if [[ -x /usr/sbin/detectloader ]]; then + LOADER=$(/usr/sbin/detectloader -q) + if [[ $LOADER = "LILO" ]] && [[ -x /sbin/lilo ]];then + /sbin/lilo >/dev/null 2>/dev/null + fi + if [[ $LOADER = "YABOOT" ]] && [[ -x /sbin/ybin ]];then + /sbin/ybin >/dev/null 2>/dev/null + fi + fi + fi + popd &> /dev/null +} + function usage () { basename=`basename $0` cat <<EOF @@ -154,3 +175,4 @@ fi check_it $theme switch_theme $theme +update_boot |