#!/bin/sh # cloudmin-debian-install.sh # Copyright 2005-2009 Virtualmin, Inc. # # Installs Cloudmin for physical systems and all dependencies on a # Debian or Ubuntu system if [ "$SERIAL" = "" ]; then SERIAL=12345678 fi if [ "$KEY" = "" ]; then KEY=xxxxxxx fi VER=1.1 # Define functions yesno () { while read line; do case $line in y|Y|Yes|YES|yes|yES|yEs|YeS|yeS) return 0 ;; n|N|No|NO|no|nO) return 1 ;; *) printf "\nPlease enter y or n: " ;; esac done } # Ask the user first cat </etc/apt/sources.list.clean mv /etc/apt/sources.list.clean /etc/apt/sources.list # Check for apt-get echo Checking for apt-get .. if [ ! -x /usr/bin/apt-get ]; then echo .. not installed. The Cloudmin installer requires APT to download packages echo "" exit 1 fi echo .. found OK echo "" # Make sure we have wget echo "Installing wget .." apt-get -y install wget echo ".. done" echo "" # Check for wget or curl echo "Checking for curl or wget..." if [ -x "/usr/bin/curl" ]; then download="/usr/bin/curl -s " elif [ -x "/usr/bin/wget" ]; then download="/usr/bin/wget -nv -O -" else echo "No web download program available: Please install curl or wget" echo "and try again." exit 1 fi echo "found $download" echo "" # Validate licence with wget echo Validating Cloudmin serial number and key .. $download "http://${SERIAL}:${KEY}@cloudmin.virtualmin.com/real/" >/dev/null if [ "$?" != 0 ]; then echo .. license does not appear to be valid exit 1 fi echo .. done echo "" # Create Cloudmin licence file echo Creating Cloudmin licence file .. cat >/etc/server-manager-license </tmp/RPM-GPG-KEY-virtualmin if [ "$?" != 0 ]; then echo .. download failed exit 1 fi $download "http://software.virtualmin.com/lib/RPM-GPG-KEY-webmin" >/tmp/RPM-GPG-KEY-webmin if [ "$?" != 0 ]; then echo .. download failed exit 1 fi echo .. done echo "" # Import keys echo Importing GPG keys .. apt-key add /tmp/RPM-GPG-KEY-virtualmin && apt-key add /tmp/RPM-GPG-KEY-webmin if [ "$?" != 0 ]; then echo .. import failed exit 1 fi echo .. done echo "" # Setup the APT sources file echo Creating APT repository for Cloudmin packages .. cat >>/etc/apt/sources.list <