slitaz-vz view base-scripts/local.sh @ rev 5

Tiny edits
author Paul Issott <paul@slitaz.org>
date Mon Mar 26 21:42:12 2012 +0100 (2012-03-26)
parents 2d20f72ffb19
children
line source
1 #!/bin/sh
2 # /etc/init.d/local.sh - Local startup commands.
3 #
4 # All commands here will be executed at boot time.
5 #
6 . /etc/init.d/rc.functions
8 #~ (°- { Documentation dans /usr/share/doc. Utiliser 'less -EM' pour,
9 #~ //\ lire des fichiers, devenir root avec 'su' et éditer avec 'nano'.
10 #~ v_/_ Taper 'startx' pour lancer une session X. }
13 echo "Starting local startup commands... "
15 echo "SliTaz GNU/Linux (`cat /etc/slitaz-release`)" > /etc/motd
16 echo >> /etc/motd
17 echo "(°- { Documentation dans /usr/share/doc. Utiliser 'less -EM' pour," >> /etc/motd
18 echo "//\ lire des fichiers, devenir root avec 'su' et éditer avec 'nano'." >> /etc/motd
19 echo "v_/_ Acces au panel : http://<adresse_ip>:3000 }" >> /etc/motd
20 echo >> /etc/motd
21 echo "Kernel : `uname -r`" >> /etc/motd
22 echo "hostname : `hostname`" >> /etc/motd
23 echo "ip : $(ifconfig br0 | grep inet | \
24 cut -d ':' -f2 | cut -d ' ' -f1)" >> /etc/motd
25 echo >> /etc/motd
27 echo "SliTaz GNU/Linux $(cat /etc/slitaz-release) ($(ifconfig br0 | grep inet | \
28 cut -d ':' -f2 | cut -d ' ' -f1))" > /etc/issue
29 echo >> /etc/issue
31 echo " * Settings Kernel parameters"
32 /sbin/sysctl -w -p /etc/sysctl.conf > /dev/null 2>&1
34 # Setting up owp and VZ in Live mode
35 if [ ! -f /var/lib/slitaz-vz ]; then
36 # vzquota doesn't work in live mode ( http://labs.slitaz.org/issues/380 )
37 sed -i s/DISK_QUOTA=yes/DISK_QUOTA=no/ /etc/vz/vz.conf
39 /usr/bin/ruby /usr/share/ovz-web-panel/utils/hw-daemon/hw-daemon.rb stop > /dev/null 2>&1
41 echo " * Settings hw-daemon"
42 echo "address = 127.0.0.1" > /usr/share/ovz-web-panel/utils/hw-daemon/hw-daemon.ini
43 echo "port = 7767" >> /usr/share/ovz-web-panel/utils/hw-daemon/hw-daemon.ini
45 export RAND_KEY=`head -c 200 /dev/urandom | md5sum | awk '{ print \$1 }'`
46 echo "key = $RAND_KEY" >> /usr/share/ovz-web-panel/utils/hw-daemon/hw-daemon.ini
48 # Add localhost in server list
49 echo " * Adding localhost to the list of controlled servers..."
50 #/usr/bin/ruby /usr/share/ovz-web-panel/script/runner -e production "HardwareServer.new(:host => 'localhost', :auth_key => '"$(echo $RAND_KEY)"').co
51 sqlite3 /usr/share/ovz-web-panel/db/production.sqlite3 "insert into hardware_servers(host,auth_key) values('localhost','"$(echo $RAND_KEY)"')"
52 /usr/bin/ruby /usr/share/ovz-web-panel/utils/hw-daemon/hw-daemon.rb start
54 # Create slitaz-vz will prevent this config.
55 date > /var/lib/slitaz-vz
56 fi