[[
I'm pretty sure I can do this programmatically with simple Bash scripting; but is there a way in-VE to have it determine what its number is on the host? (i.e. VE 1003 should "know" it's number is 1003 somehow without having networking enabled yet.)
]]
--What I've got so far is that beancounters knows what its VE number is:
BEGIN VE 101 /etc/init.d/rc.local (PARTIAL)
do_start() {
if [ -x /etc/rc.local ]; then
[ "$VERBOSE" != no ] && log_begin_msg "Running local boot scrip
/etc/rc.local
ES=$?
[ "$VERBOSE" != no ] && log_end_msg $ES
return $ES
fi
# Openvz mods: 2007.0528
/bin/rm /dev/shm/THISVE
thisve=`cat /proc/user_beancounters \
|grep kmemsize \
|awk '{ print $1 }'`
thisve=${thisve//:/} # Take out the trailing ":"
echo $thisve > /dev/shm/THISVE
# If THISVE < 1000, it is a Master Image.
# If not, consider it a clone:
# o Setup IP
# and start listening.
}
case "$1" in
start)