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

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

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