!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache/2.2.22 (Debian). PHP/5.6.36 

uname -a: Linux h05.hvosting.ua 4.9.110-amd64 #3 SMP Sun Nov 4 16:27:09 UTC 2018 x86_64 

uid=1389(h33678) gid=1099(h33678) groups=1099(h33678),502(mgrsecure) 

Safe-mode: OFF (not secure)

/root/scripts_backup/ispmgr/   drwxr-xr-x
Free 1.48 GB of 7.22 GB (20.57%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     install.sh (4.5 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#!/bin/sh
# ISPsystem install v.4

Usage()
{
	cat << EOU >&2

Usage:
	$0 --help 	Print this help

	$0 [options] [mgrname]
	--os OS		Force use OS distribution
	--arch ARCH	Force use ARCH architecture
	--ip IP		Use IP for licence check
	
EOU
}

DetectFetch()
{
	if test -x /usr/bin/fetch; then
		fetch="/usr/bin/fetch -o "
	elif test -x /usr/bin/wget; then
		fetch="/usr/bin/wget -O "
	elif test -x /usr/bin/curl; then
		fetch="/usr/bin/curl -o "
	else
		echo "ERROR: no fetch program found."
		exit 1
	fi
}

DetectMd5()
{
	if test -x /sbin/md5; then
		md5="/sbin/md5 "
		isit=true
	elif test -x /usr/bin/md5sum; then
		md5="/usr/bin/md5sum "
		isit=false
	else
		echo "ERROR: no programm for checksum found."
		exit 1
	fi
}

DetectOS()
{
	kern=`uname -s`
	case "$kern" in
		FreeBSD)
			ver=`uname -r|sed -E 's/^([0-9]+\.[0-9]+).*$/\1/'`
			os="$kern-$ver"
			;;
		Linux)
			os="Linux-cc6"
#			if test -e "/usr/lib/libstdc++.so.7" -o -e "/usr/lib/libstdc++-v3/libstdc++.so.7"; then
#				os="Linux-cc7"
#			elif test -e "/usr/lib/libstdc++.so.6" -o -e "/usr/lib/libstdc++-v3/libstdc++.so.6"; then
#				os="Linux-cc6"
#			else
#				os="Linux-cc5"
#			fi	
			;;
		*)
			echo "Unknown OS type"
			exit 1
			;;
	esac
}

DetectArch()
{
	arch=`uname -m`
}

echo
echo "ISPsystem install v.4"
echo

while true
do
	case "$1" in 
		-h | --help)
			Usage
			exit 0
			;;
		--os)
			os=${2:-.}
			shift 2
			;;
		--arch)
			arch=${2:-.}
			shift 2
			;;
		--ip)
			ip=${2:-.}
			ipparam="ip=$ip"
			shift 2
			;;
		-*)
			echo Unrecognized flag : "$1" >&2
			Usage
			exit 1
			;;
		*)
			break ;;
	esac
done

DetectFetch
DetectMd5

if test "$os" = ""; then
	DetectOS
fi

if test "$arch" = ""; then
	DetectArch
fi

if test $# -eq 0 ; then
	# choose manager
	list=`$fetch - -q "http://lic.ispsystem.com/liclist.cgi?$ipparam"`
	
	if test "$list" = "no_license_found"; then
		echo "You have no active licenses"
		exit 1
	fi

	while true 
	do
		j="1"
		for i in $list; do
			echo "$j) $i"
			eval "mgrval$j=$i"
			j=$(($j+1))
		done
	
		echo "0) Exit"
		echo
		read -p "Please choose software to install: " n
		echo
		
		if test "$n" = "0"; then
			exit 0
		fi
	
		eval mgrname=\$mgrval$n
		if test "$mgrname" != ""; then
			break;
		fi
	done
else
	mgrname=$1
fi

if test -x /usr/bin/ntpdate; then
	/usr/bin/ntpdate -b pool.ntp.org
fi

tmpdir="/tmp/$mgrname"
mkdir -p $tmpdir
cd $tmpdir

goon="true"
while [ $goon = "true" ]
do
	goon="false"
	echo "1) ru.download.ispsystem.com"
	echo "2) us.download.ispsystem.com"
	echo "3) be.download.ispsystem.com"
	echo
	read -p "Please choose mirror to install from: " n
	echo

	if [ "$n" = "1" ]; then mirror="ru.download.ispsystem.com"
	elif [ "$n" = "2" ]; then mirror="us.download.ispsystem.com"
	elif [ "$n" = "3" ]; then mirror="be.download.ispsystem.com"
	else goon="true"; fi
done

stable="false"
goon="true"
while [ $goon = "true" ]
do
    goon="false"
    echo "1) beta version - has the latest functionality"
    echo "2) stable version - time-proved version"
    echo
    read -p "Please choose version to install: " n
    echo

    if [ "$n" = "1" ]; then 
		url="http://$mirror/$os/$arch/$mgrname/install.tgz"
    elif [ "$n" = "2" ]; then
		url="http://$mirror/$os/$arch/$mgrname/install.stable.tgz"
		stable="true";
    else goon="true"; fi
done

archive="$tmpdir/install.tgz"

test -f $archive && rm -f $archive
$fetch $archive "$url"

if ! test -s $archive; then
	echo "Can't download $mgrname distribution"
	echo "Make sure it is available for your platform ($os $arch)"
	echo "List of supported distribution you can see at"
	echo "http://download.ispsystem.com/"
	echo "see $0 --help for more information"
	rm -rf $tmpdir
	exit 1
fi

# check md5
$fetch $archive.md5 "$url.md5"

if test "$isit" = "true"; then
	remotesum=`cat $archive.md5 | awk '{print $4}'`
	localsum=`$md5 install.tgz | awk '{print $4}'`
else
	remotesum=`cat $archive.md5 | awk '{print $1}'`
	localsum=`$md5 install.tgz | awk '{print $1}'`
fi

if test "$localsum" != "$remotesum"; then
	echo "Invalid MD5 signature"
	echo "Please try again."
	rm -rf $tmpdir
	exit 1
fi

mgrdir="/usr/local/ispmgr/"
mkdir -p $mgrdir
cd $mgrdir
bin=`tar xvzpf $archive 2>&1 | grep -v 'sbin' | grep 'bin/.' | sed -e 's/^.*\///'`
rm -rf $tmpdir

echo "Mirror http://$mirror/" >> $mgrdir/etc/dist/$bin.conf
if test "$stable" = "true"; then
	echo "Release stable" >> $mgrdir/etc/dist/$bin.conf
fi

installname=`echo ${mgrname} | sed -e 's/-.*$//'`

if test "$installname" = "ISPmanager"; then
	$fetch etc/ispmgr.lic -q "http://lic.ispsystem.com/ispmgr.lic?$ipparam"
fi

sh sbin/${installname}-install.sh $mirror $ip



:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by PinoyWH1Z | C99Shell Github | Generation time: 0.013 ]--