slitaz-vz annotate base-scripts/local.sh @ rev 6

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