#!/bin/bash

v="VPS-server.RU version 0.2 Beta :o)"
echo "#-----------------------------------------------#"
echo " VDSManager Installer for CentOS 6 and Debian 6"
echo " $v"
echo "#-----------------------------------------------#"

os=$(cat /etc/*release |egrep -i "CentOS.* release 6|Debian.*Linux 7")

if [ "$os" == 0  ]; then
	echo "Only Debian 6 and CentOS 6 supported!"
	echo -n "Continue ? (y/N) Да, продолжаем? (д/Н): "; read input
	if ! [ "$input" == "y" ]; then
		exit 0
	fi
fi

isp_path="/usr/local/ispmgr"

if ! [ -d $isp_path ]; then
	mkdir $isp_path
fi
cd $isp_path; wget -O $isp_path/install.tgz http://download.ispsystem.com/Linux-cc6/x86_64/VDSmanager-Linux/install.tgz

tar xfz install.tgz -C $isp_path

/bin/bash "$isp_path/sbin/VDSmanager-install.sh"
