source: src-sh/xtrafiles/local/share/pcbsd/scripts/sys-init.sh @ 0783e9b

9.2-releasereleng/10.0releng/10.0.1releng/10.0.2
Last change on this file since 0783e9b was 0783e9b, checked in by Kris Moore <kris@…>, 16 months ago

Remove some obsolete files now in trueos SRC repo

Set pcbsd_load="YES" in /boot/loader.conf when we init a desktop. This
will enable the PC-BSD 4th loader menu

  • Property mode set to 100755
File size: 1.9 KB
Line 
1#!/bin/sh
2# Script which does some first time init
3
4case $1 in
5 desktop|server) ;;
6              *) echo "Error: Please specify 'desktop' or 'server'"
7                 exit 1
8                 ;;
9esac
10
11################################################
12# Do generic init
13################################################
14
15if [ ! -d "/usr/home" ] ; then
16   mkdir /usr/home
17fi
18
19# Setup /home link
20if [ ! -e "/home" ] ; then
21  ln -s /usr/home /home
22fi
23
24# Init the firewall
25sh /usr/local/share/pcbsd/scripts/reset-firewall
26
27# Update XDG menus
28/usr/local/bin/pc-xdgutil updatemenu
29
30# Update ports overlay files
31/usr/local/bin/pc-extractoverlay ports
32
33################################################
34# Do desktop specific init
35################################################
36if [ "$1" = "desktop" ] ;then
37  # Allow shutdown / reboot from hal
38  polkit-action --set-defaults-any org.freedesktop.hal.power-management.shutdown yes
39  polkit-action --set-defaults-any org.freedesktop.hal.power-management.reboot yes
40
41  # Init the flash plugin for all users
42  cd /home
43  for i in `ls -d * 2>/dev/null`
44  do
45    su ${i} -c "flashpluginctl off"
46    su ${i} -c "flashpluginctl on"
47  done
48
49  # Enable the system updater tray
50  pbreg set /PC-BSD/SystemUpdater/runAtStartup true
51
52  # Set running desktop
53  pbreg set /PC-BSD/SysType PCBSD
54  touch /etc/defaults/pcbsd
55
56  # Enable showing the PC-BSD 4th screen
57  echo "pcbsd_load=\"YES\"" >> /boot/loader.conf
58
59  # Init the desktop
60  /usr/local/bin/pc-extractoverlay desktop --sysinit
61
62  # Need to save a language?
63  if [ -n "$2" ] ; then
64     echo "$2" > /etc/pcbsd-lang
65  fi
66  exit $?
67fi
68
69################################################
70# Do server specific init
71################################################
72if [ "$1" = "server" ] ; then
73  # Set running a server
74  pbreg set /PC-BSD/SysType TRUEOS
75  touch /etc/defaults/trueos
76
77  # Init the server
78  /usr/local/bin/pc-extractoverlay server --sysinit
79  exit $?
80fi
Note: See TracBrowser for help on using the repository browser.