[services-cvs] CVS services/proc

CVS User miham root at tempel.bibl.u-szeged.hu
2004. Nov. 13., Szo, 21:41:56 CET


Update of /var/lib/cvs/services/proc
In directory tempel:/tmp/cvs-serv25118/services/proc

Modified Files:
	boinc.sh 
Log Message:
Nah, ez is kellett

Majd megirom szebben, ez igy csunyacska
Majd az ifup_serpub() helyett altalanosabb cucc lesz, ami m4 segitsegevel 
allitja majd elo a hasznalando IP-t.
Es nyilvan lesz egy leallito parja.
Tovabba nem feltetlenul auto-ra irja bele az interfaces fileba..

Na, majd alakitunk rajta..


--- /var/lib/cvs/services/proc/boinc.sh	2004/11/13 19:17:57	1.9
+++ /var/lib/cvs/services/proc/boinc.sh	2004/11/13 20:41:55	1.10
@@ -31,12 +31,45 @@
 #	. /etc/default/$NAME
 #fi
 
+ifup_serpub() {
+  decho 1 -ne "Bringing up interface to SERPUB VLAN.."
+  grep "eth0.0300" /etc/network/interfaces >>/dev/null 2>>/dev/null
+  if [ $? -eq 0 ]; then
+    ifconfig | grep "eth0.0300" >>/dev/null 2>>/dev/null
+    if [ $? -eq 0 ]; then
+      decho 2 -ne 'Interface already up!\n'
+      return
+    else
+      decho 2 -ne 'Bringing up interface..'
+      ifup eth0.0300
+      decho 2 -ne '. Ok!\n'
+    fi
+  else
+    decho 2 -ne "Configuring interface.."
+    hostnum=$(hostname | cut -c5-)
+    serpubip=$(expr 140 + ${hostnum})
+    echo "auto eth0.0300" >> /etc/network/interfaces
+    echo "iface eth0.0300 inet static" >> /etc/network/interfaces
+    echo -ne "\taddress 160.114.159.${serpubip}\n" >> /etc/network/interfaces
+    echo -ne "\tnetmask 255.255.255.128\n" >> /etc/network/interfaces
+    echo -ne "\tnetwork 160.114.159.128\n" >> /etc/network/interfaces
+    echo -ne "\tbroadcast 160.114.159.255\n" >> /etc/network/interfaces
+    echo -ne "\tgateway 160.114.159.129\n" >> /etc/network/interfaces
+    decho 2 -ne '. Ok!\n'
+  
+    decho 2 -ne 'Bringing up interface..'
+    ifup eth0.0300
+    decho 2 -ne '. Ok!\n'
+    decho 1 -ne '. Ok!\n'
+  fi
+}
+
 #
 #	Function that starts the service.
 #
 d_cleanstart() {
   decho 1 -ne "\nInstalling packages essential to start service.."
-  apt-get -q -f install ia32-libs debootstrap lvm2
+  apt-get -q -f install ia32-libs debootstrap lvm2 vlan
   decho 1 -ne '. Ok!\n';
   decho 1 -ne "Creating & setting up logical volume for BOINC.."
   lvcreate -L 5G -n boinc main
@@ -62,6 +95,8 @@
   decho 1 -ne "Installing BOINC configfiles.."
   download_config "http://androm.biblserv.intra/boinc/account_climateprediction.net.xml" "/boinc/boinc/account_climateprediction.net.xml"
   decho 1 -ne '. Ok!\n';
+  ## We HAVE TO bring up eth0 to VLAN ID 300..
+  ifup_serpub
   decho 1 -ne "Mounting necessary partitions (dev, proc).."
   mount --bind /dev -t devfs /boinc/dev
   decho 0 -ne '.';
@@ -88,9 +123,10 @@
   mount /dev/mapper/main-boinc /boinc -t ext2 2>>/dev/null >>/dev/null
   decho 1 -ne '. Ok!\n';
   decho 1 -ne "Installing base system (i386) for BOINC.."
-#  debootstrap --arch i386 --exclude=aptitude,at,cron,exim4,exim4-base,exim4-config,exim4-daemon-light,info,logrotate,mailx,nano,ppp,pppconfig,pppoe,pppoeconf,tasksel,telnet,dhcp-client,libgnutls10,libgnutls11 sid /boinc http://ftp.fsn.hu/debian/
   debootstrap --arch i386 sid /boinc http://ftp.fsn.hu/debian/ 2>>/dev/null >>/dev/null
   decho 1 -ne '. Ok!\n';
+  ## We HAVE TO bring up eth0 to VLAN ID 300..
+  ifup_serpub
   decho 1 -ne "Retrieving BOINC with datafiles.."
   download_config "http://xenon.bibl.u-szeged.hu/~boinc/kulcs" "/boinc/tmp/id_dsa"
   decho 1 -ne "."





További információk a(z) Services-cvs levelezőlistáról