klikohost
New member
- Joined
- Aug 3, 2020
- Messages
- 3
hello to all i have problem with CustomBuild i try to update WAF and when i go to DA>Extra Features>CustomBuild Just Loading like on the photo
But i have just 160 lines of code
How cen i repair this problem, I running on Ubuntu 18.04 DA
Code:
Executing /usr/local/directadmin/plugins/custombuild/admin/build update...
/usr/local/directadmin/custombuild/build: line 161: syntax error: unexpected end of file
But i have just 160 lines of code
Code:
#!/bin/sh
# This script is written by DirectAdmin and Martynas Bendorius (smtalk)
BUILDSCRIPT_VER=2.0.0
NAME=custombuild
OS=`uname`
WORKDIR=/usr/local/directadmin/${NAME}
cd ${WORKDIR}
#Added for security
chmod 700 ${WORKDIR}/build >/dev/null 2>&1
chmod 700 ${WORKDIR} >/dev/null 2>&1
#Just making sure there are no default grep options set in .bashrc
GREP_OPTIONS=""
if [ "$(id -u)" != "0" ]; then
echo "You must be root to execute the script. Exiting."
exit 1
fi
doHook(){
if [ ! -z "${1}" ] && [ ! -z "${2}" ]; then
if [ -d ${WORKDIR}/custom/hooks/${1}/${2} ]; then
find ${WORKDIR}/custom/hooks/${1}/${2} -type f -name '*.sh' | while read line; do
echo "Executing '$line'..."
. "$line"
done
HOOK_ERROR_CODE=$?
if [ ${HOOK_ERROR_CODE} -ne 0 ]; then
echo "Hook exited with error code: ${HOOK_ERROR_CODE}. Exiting..."
exit ${HOOK_ERROR_CODE}
fi
fi
fi
}
OPTIONS_CONF=${WORKDIR}/options.conf
PHP_EXTENSIONS_CONF=${WORKDIR}/php_extensions.conf
OPTIONS_CONF_EXISTS=1
if [ ! -e ${OPTIONS_CONF} ]; then
OPTIONS_CONF_EXISTS=0
fi
VERSIONS_FILE=${WORKDIR}/versions.txt
PATCHES_VERSIONS_FILE=${WORKDIR}/patches_versions.txt
VERSIONS_FILE_CUSTOM=${WORKDIR}/custom_versions.txt
VERSIONS_FILE_CL=${WORKDIR}/versions_cl.txt
VERSIONS_FILE_CWAF=${WORKDIR}/versions_cwaf.txt
VERSIONS_FILE_LITESPEED=${WORKDIR}/versions_litespeed.txt
VERSIONS_FILE_JEMALLOC=${WORKDIR}/mysql/versions_jemalloc.txt
VERSIONS_FILE_GALERA=${WORKDIR}/mysql/versions_galera.txt
LOCKFILE=${WORKDIR}/.custombuild
LOGFILE=${WORKDIR}/custombuild.log
PROFTPD_PREFIX=/usr
B64=0
EXEC_CL_COMMANDS_ONCE=false
CL_COMPONENT_UPDATE=false
CPU_CORES=1
DA_BIN=/usr/local/directadmin/directadmin
if [ ${OS} = "FreeBSD" ]; then
MD5SUM=/sbin/md5
else
MD5SUM=/usr/bin/md5sum
fi
is_os_eol() {
EOL_FILE=${WORKDIR}/configure/custombuild/eol_os.txt
if [ -e ${WORKDIR}/custom/custombuild/eol_os.txt ]; then
EOL_FILE=${WORKDIR}/custom/custombuild/eol_os.txt
fi
DA_OS=`${DA_BIN} o | head -n1 | cut -d"'" -f2 | cut -d"." -f1`
if grep -m1 -q "^${DA_OS}$" ${EOL_FILE}; then
echo 1
else
echo 0
fi
return
}
EXIT_CODE=0
LANG=C
LSWS_HOME=/usr/local/lsws
# Emulate ${!variable}
eval_var() {
var=${1}
if [ -z ${var} ]; then
echo ""
else
eval newval="\$${var}"
echo $newval
fi
}
removeLockfile() {
rm -f ${LOCKFILE}
trap - INT TERM EXIT
}
kill_childs() {
if [ -s ${LOCKFILE} ]; then
CB_PID=`cat ${LOCKFILE}`
for process in `ps -ef | awk -v cb_pid=${CB_PID} '{ if ( $3 == cb_pid ) { print $2 }}'`; do
kill ${process}
done
fi
}
doKill() {
if [ -s ${LOCKFILE} ]; then
kill_childs
removeLockfile
kill -9 ${CB_PID}
exit 0
else
echo "There is no CustomBuild process running."
fi
exit 0
}
getTimezone() {
if [ "${OS}" = "FreeBSD" ]; then
if [ -d /usr/share/zoneinfo ] && [ -e /etc/localtime ]; then
MD5_LOCALTIME=`md5 /etc/localtime | awk '{print $4}'`
# we don't use 'grep -m1' here to fix: "xargs: md5: terminated with signal 13; aborting"
DATETIMEZONE="`find /usr/share/zoneinfo -type f -print0 | xargs -0 md5 | grep "${MD5_LOCALTIME}" | awk '{print $2}' | cut -d\( -f2 | cut -d\) -f1 | perl -p0 -e 's#/usr/share/zoneinfo/##'`"
fi
elif [ -e ${DEBIAN_VERSION} ]; then
if [ -e /etc/timezone ]; then
DATETIMEZONE="`cat /etc/timezone`"
fi
else
if [ -e /etc/sysconfig/clock ]; then
DATETIMEZONE="`grep -m1 '^ZONE=' /etc/sysconfig/clock | cut -d'"' -f2 | cut -d= -f2`"
elif [ -e /usr/bin/timedatectl ]; then
DATETIMEZONE="`timedatectl | grep -m1 'Time.*zone:' | cut -d: -f2 | awk '{print $1}'`"
fi
fi
if [ "${DATETIMEZONE}" = "" ]; then
DATETIMEZONE="Europe/London"
fi
echo ${DATETIMEZONE} | awk '{print $1}'
}
random_pass() {
#No special characters yet, because they'd cause problems with regexes and PEAR::DB to split the DNS string correctly in roundcube config.inc.php
if [ "${OS}" = "FreeBSD" ]; then
RPC=${1:-`perl -le 'print int rand(7) + 10'`}
else
RPC=`awk -v min=10 -v max=17 'BEGIN{srand(); print int(min+rand()*(max-min+1))}'`
fi
tr -cd 'a-zA-Z0-9' < /dev/urandom 2>/dev/null | head -c${RPC} # perl generat
How cen i repair this problem, I running on Ubuntu 18.04 DA