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

9.1-release9.2-releasereleng/10.0releng/10.0.1releng/10.0.2releng/10.0.3
Last change on this file since 1620346 was 1620346, checked in by Kris Moore <kris@…>, 17 months ago

Initial import of PC-BSD /current/ SVN repo

  • Property mode set to 100755
File size: 1.8 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
55  # Init the desktop
56  /usr/local/bin/pc-extractoverlay desktop --sysinit
57
58  # Need to save a language?
59  if [ -n "$2" ] ; then
60     echo "$2" > /etc/pcbsd-lang
61  fi
62  exit $?
63fi
64
65################################################
66# Do server specific init
67################################################
68if [ "$1" = "server" ] ; then
69  # Set running a server
70  pbreg set /PC-BSD/SysType TRUEOS
71
72  # Init the server
73  /usr/local/bin/pc-extractoverlay server --sysinit
74  exit $?
75fi
Note: See TracBrowser for help on using the repository browser.