Changeset 4950767


Ignore:
Timestamp:
05/08/13 17:43:16 (20 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3, releng/10.1
Children:
6f96fdf
Parents:
6f68384
Message:

Add function to run the first-boot wizard, will be called by a few different scripts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-sh/libsh/functions.sh

    r6f2048f r4950767  
    561561  return 1 
    562562} 
     563 
     564# Run the first boot wizard 
     565# Should be called from a .xinitrc script, after fluxbox is already running 
     566run_firstboot() 
     567{ 
     568  # Is the trigger file set? 
     569  if [ ! -e "/var/.pcbsd-firstgui" ] ; then return; fi 
     570 
     571  # Set all our path variables 
     572  PATH="/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/bin:/usr/local/sbin" 
     573  HOME="/root" 
     574  export PATH HOME 
     575 
     576  # Unset the PROGDIR variable 
     577  PROGDIR="" 
     578  export PROGDIR 
     579 
     580  if [ -e "/root/.xprofile" ] ; then . /root/.xprofile ; fi 
     581 
     582  # Figure out which intro video to play 
     583  res=`xdpyinfo | grep dimensions: | awk "{print $2}"` 
     584  h=`echo $res | cut -d "x" -f 1` 
     585  w=`echo $res | cut -d "x" -f 2` 
     586  h=`expr 100 \* $h` 
     587  ratio=`expr $h \/ $w | cut -c 1-2` 
     588  case $ratio in 
     589    13) mov="PCBSD9_4-3_UXGA.flv";; 
     590    16) mov="PCBSD9_16-10_WUXGA.flv";; 
     591    17) mov="PCBSD9_16-9_1080p.flv";; 
     592     *) mov="PCBSD9_4-3_UXGA.flv";; 
     593  esac 
     594 
     595  # Play the video now 
     596  mplayer -fs -nomouseinput -zoom /usr/local/share/pcbsd/movies/$mov 
     597 
     598  # Setting a language 
     599  if [ -e "/etc/pcbsd-lang" ] ; then 
     600    LANG=`cat /etc/pcbsd-lang` 
     601    export LANG 
     602  fi 
     603 
     604  # Start first-boot wizard 
     605  /usr/local/bin/pc-firstboot 
     606  if [ $? -eq 0 ] ; then 
     607    rm /var/.pcbsd-firstgui 
     608  fi 
     609} 
Note: See TracChangeset for help on using the changeset viewer.