Kadischi/Development/07conf

=Fedora Kadischi Development= The following script was coded by MattBird.

This is a "under development" zone. The author takes no responsibility whatsoever.
 * Kadischi
 * Development
 * Mailing List

Progress
The script below which I have installed as /usr/local/share/kadischi/post_install_scripts/07conf.pl runs after the other Kadischi 'post install scripts' and sets the Gnome desktop background, splash screen and the run level for the Live CD. As the script runs it will prompt the user for chosen settings. It will then adjust the config for the live CD. Unlike previous versions this script may be run 'as is' although regular users of Kadischi may find it useful to change the Default settings section.

I hacked this together for my own use, its included in the hope someone else may benifit. --MattBird


 * 1) !/usr/bin/perl

my $dsrcfile=qq{/PATH/TO/IMAGE.png};   #Default Desktop Image my $dspsrcfile=qq{/PATH/TO/IMAGE.png}; #Default Splash Image my $dnewrunlev=3;

open (CONF, "/etc/kadischi/kadischi.conf");   #Was build.conf in earlier versions @CONF=; close (CONF);

@BDIR=grep(/BUILDDIR=/, @CONF); $BDIR=@BDIR[1] ; ($tmp,$builddir)= split(/=/,$BDIR);

@BNUM=grep(/BUILDNUM=/, @CONF); $BNUM=@BNUM[0] ; ($tmp,$buildnum)= split(/=/,$BNUM); chomp ($buildnum); chomp($builddir);

print "Enter full path to new desktop image\n"; $srcfile=<>;chomp($srcfile); if ($srcfile==""){$srcfile=$dsrcfile};  #Dont replace if 'Enter'

print "Enter full path to new splash screen\n"; $spsrcfile=<>;chomp($spsrcfile); if ($spsrcfile==""){$spsrcfile=$dspsrcfile};  #Dont replace if 'Enter'

print "Enter new run level\n"; $newrunlev=<>;chomp($newrunlev);

if ($newrunlev==""){$newrunlev=$dnewrunlev};       #Dont replace if 'Enter'

my $destfile=qq{/$builddir/livecd-build_no$buildnum/system/usr/share/backgrounds/images/default.png};

@copydesktop = ("cp", "$srcfile", "$destfile");

system(@copydesktop);

my $spdestfile=qq{/$builddir/livecd-build_no$buildnum/system/usr/share/pixmaps/splash/gnome-splash.png}; @copysplash = ("cp", "$spsrcfile", "$spdestfile"); system(@copysplash);

open (INTB, "/$builddir/livecd-build_no$buildnum/system/etc/inittab"); @INTB=; close (INTB); my $newval=qq{id:$newrunlev:initdefault:}; foreach $elem (@INTB){ if ($elem=~"id"){ $elem=$newval; } }

open (WINTB,">/$builddir/livecd-build_no$buildnum/system/etc/inittab"); print WINTB "@INTB"; close (WINTB);