RT notifier: parse templates without header correctly
[openxpki.git] / trunk / package / morphix / openxpki_live_boot.sh
blob831a6aa0439c801f14bccd821f2ffbf5f5d673f2
1 #!/bin/sh
2 #echo 'firefox http://openxpkilive &' > /etc/X11/Xsession.d/60firefox_localhost
3 # set desktop background image
4 update-alternatives --install /etc/alternatives/desktop-background desktop-background /morphix/background.png 1
5 update-alternatives --set desktop-background /morphix/background.png
6 ln -s /etc/alternatives/desktop-background /usr/share/images/desktop-base/desktop-background
7 # FIXME - does not seem to work
8 echo 'pref("browser.startup.homepage", "http://localhost/");' >> /etc/iceweasel/pref/iceweasel.js
9 # hide xfce tips
10 mkdir -p ~openxpkilive/.config/autostart
11 (echo '[Desktop Entry]'; echo 'Hidden=true') > ~openxpkilive/.config/autostart/xfce4-tips-autostart.desktop
12 /etc/init.d/apache start
13 # copy index from drive/USB if present
14 LOCALINDEX=$(find /media -maxdepth 2 -name 'openxpki_live_index.html' 2>/dev/null|head -1)
15 if [ "$LOCALINDEX" != "" ]; then
16 cp $LOCALINDEX /var/www/index.htm
18 MOUNTPOINT=$(find /media -maxdepth 2 -name 'openxpki_live.ext2' 2>/dev/null|head -1)
19 MOUNTPOINT=$(dirname $MOUNTPOINT)
20 if [ "$MOUNTPOINT" == "" ]; then
21 echo "No OpenXPKI live persistent image found, using temporary CA for testing only"
22 exit 1
24 echo "Found image at $MOUNTPOINT, relinking OpenXPKI configuration and MySQL databases"
25 /etc/init.d/openxpkid stop
26 /etc/init.d/mysql stop
27 losetup /dev/loop0 ${MOUNTPOINT}/openxpki_live.ext2
28 mkdir /mnt/loop
29 mount /dev/loop0 /mnt/loop
30 echo 'umount /mnt/loop; losetup -d /dev/loop0' > /etc/rc0.d/S15local
31 chmod 755 /etc/rc0.d/S15local
32 # copy config and MySQL database to image, create symbolic links
33 rm -rf /var/lib/mysql
34 ln -s /mnt/loop/openxpki_live/var/lib/mysql /var/lib/mysql
35 rm -rf /etc/openxpki
36 ln -s /mnt/loop/openxpki_live/etc/openxpki /etc/openxpki
37 rm -rf /etc/mysql
38 ln -s /mnt/loop/openxpki_live/etc/mysql /etc/mysql
39 /etc/init.d/mysql start
40 openxpkictl stop
41 openxpkictl start
42 echo 'Listen 127.0.0.1:80' >> /etc/apache/httpd.conf
43 /etc/init.d/apache stop
44 /etc/init.d/apache start
45 if [ -x /mnt/loop/boot.sh ]; then
46 /mnt/loop/boot.sh