source: src-sh/pc-firstgui/pc-firstgui @ 6ffb65b

9.2-releasereleng/10.0releng/10.0.1releng/10.0.2releng/10.0.3releng/10.1
Last change on this file since 6ffb65b was 6f96fdf, checked in by Kris Moore <kris@…>, 18 months ago

Add ability to start first boot wizard immediately after the X gui is run

This means we don't have to wait for X to shutdown, then re-launch and may fix some
bugs with X shutdowns causing a crash

  • Property mode set to 100644
File size: 1.2 KB
RevLine 
[1620346]1#!/bin/sh
2# Script to startup the first run setup gui
3
[6f96fdf]4# Source our functions
5. /usr/local/share/pcbsd/scripts/functions.sh
6
[1620346]7# Check if we need to save an existing .xinitrc file
8if [ -e "/root/.xinitrc" ] ; then
9 mv /root/.xinitrc /root/.xinitrc.xbak
10fi
11
12# Check if we need to move the .fluxbox profile
13if [ -e "/root/.fluxbox" ] ; then
14  rm -rf /root/.fluxbox.xbak 2>/dev/null
15  mv /root/.fluxbox /root/.fluxbox.xbak 2>/dev/null
16fi
17
18# Copy the default fluxbox init files
19cp -R /usr/local/share/pcbsd/fluxboxinit /root/.fluxbox
20
21# Make sure we use files in /root
22HOME="/root"
23export HOME
24
25# Create the .xinitrc file
[6f96fdf]26echo '
[1620346]27
[6f96fdf]28# Source our functions
29. /usr/local/share/pcbsd/scripts/functions.sh
[1620346]30
31# Start fluxbox
32/usr/local/bin/startfluxbox &
33PID=$!
34
[6f96fdf]35# Run the firstboot wizard in functions.sh
36run_firstboot
37
[1620346]38kill -9 ${PID}' > /root/.xinitrc
39chmod 755 /root/.xinitrc
40startx
41
42
43# Put back our saved files
44rm /root/.xinitrc >/dev/null 2>/dev/null
45# Check if we need to save an existing .xinitrc file
46if [ -e "/root/.xinitrc.xbak" ] ; then
47   mv /root/.xinitrc.xbak /etc/.xinitrc
48fi
49
50# Check if we need to move the .fluxbox profile
51if [ -e "/root/.fluxbox.xbak" ] ; then
52  rm -rf /root/.fluxbox >/dev/null 2>/dev/null
53  mv /root/.fluxbox.xbak /root/.fluxbox
54fi
Note: See TracBrowser for help on using the repository browser.