Skip to content

Instantly share code, notes, and snippets.

@t9md
Created December 19, 2010 03:51
Show Gist options
  • Save t9md/747087 to your computer and use it in GitHub Desktop.
Save t9md/747087 to your computer and use it in GitHub Desktop.
OpenVZ private PtoP network VPS
#!/bin/bash
VPSID=$1IPADDR=$2
HOSTNAME=$3help(){
echo "$(basename $0) 'VPSID' 'IPADDR' 'HOSTNAME'" echo "ex) $(basename $0) 1001 192.168.3.1 vps01"}
if [ $# -ne 3 ];then
help
exit 1
fi
vzlist ${VPSID} >/dev/null 2>&1
if [ $? -eq 0 ]; then
exit
fi
vzctl create ${VPSID} --ostemplate centos-5-x86_64
vzctl set ${VPSID} --ipadd ${IPADDR} --nameserver 172.22.0.200 --hostname ${HOSTNAME} --save
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment