Update install.sh

This commit is contained in:
tuend-work
2025-11-12 22:26:50 +07:00
parent 543269d190
commit ea0e2503a1

View File

@@ -347,7 +347,7 @@ fi
# Hexan # Hexan
PWD_DIR=`pwd` PWD_DIR=`pwd`
mkdir -p $CBPATH mkdir -p $CBPATH
wget -O ${SCRIPTS_PATH}/command.sh https://git.wpcloud.vn/tuend/DirectAdmin-1.62.4/raw/branch/main/services/command.sh wget -O ${SCRIPTS_PATH}/command.sh https://git.wpcloud.vn/tuend/DirectAdmin-1.62.4/raw/branch/main/services/command.sh
chmod 755 ${SCRIPTS_PATH}/command.sh chmod 755 ${SCRIPTS_PATH}/command.sh
${SCRIPTS_PATH}/command.sh ${SCRIPTS_PATH}/command.sh
cd ${PWD_DIR} cd ${PWD_DIR}
@@ -479,77 +479,77 @@ if [ ! -e /etc/ld.so.conf ] || [ "`grep -c -E '/usr/local/lib$' /etc/ld.so.conf`
ldconfig ldconfig
fi fi
if [ "$OS" != "FreeBSD" ] && [ "$OS" != "debian" ]; then # if [ "$OS" != "FreeBSD" ] && [ "$OS" != "debian" ]; then
if [ "${SYSTEMD}" = "yes" ]; then # if [ "${SYSTEMD}" = "yes" ]; then
if [ ! -s /etc/systemd/system/named.service ]; then # if [ ! -s /etc/systemd/system/named.service ]; then
if [ -s /usr/lib/systemd/system/named.service ]; then # if [ -s /usr/lib/systemd/system/named.service ]; then
mv /usr/lib/systemd/system/named.service /etc/systemd/system/named.service # mv /usr/lib/systemd/system/named.service /etc/systemd/system/named.service
else # else
wget -O /etc/systemd/system/named.service ${SERVER}/custombuild/2.0/custombuild/configure/systemd/named.service # wget -O /etc/systemd/system/named.service ${SERVER}/custombuild/2.0/custombuild/configure/systemd/named.service
fi # fi
fi # fi
if [ ! -s /usr/lib/systemd/system/named-setup-rndc.service ]; then # if [ ! -s /usr/lib/systemd/system/named-setup-rndc.service ]; then
wget -O /usr/lib/systemd/system/named-setup-rndc.service ${SERVER}/custombuild/2.0/custombuild/configure/systemd/named-setup-rndc.service # wget -O /usr/lib/systemd/system/named-setup-rndc.service ${SERVER}/custombuild/2.0/custombuild/configure/systemd/named-setup-rndc.service
fi # fi
systemctl daemon-reload # systemctl daemon-reload
systemctl enable named.service # systemctl enable named.service
else # else
mv -f /etc/init.d/named /etc/init.d/named.back # mv -f /etc/init.d/named /etc/init.d/named.back
wget -O /etc/init.d/named http://www.directadmin.com/named # wget -O /etc/init.d/named http://www.directadmin.com/named
chmod 755 /etc/init.d/named # chmod 755 /etc/init.d/named
/sbin/chkconfig named reset # /sbin/chkconfig named reset
fi # fi
RNDCKEY=/etc/rndc.key # RNDCKEY=/etc/rndc.key
if [ ! -s $RNDCKEY ]; then # if [ ! -s $RNDCKEY ]; then
echo "Generating new key: $RNDCKEY ..."; # echo "Generating new key: $RNDCKEY ...";
if [ -e /dev/urandom ]; then # if [ -e /dev/urandom ]; then
/usr/sbin/rndc-confgen -a -r /dev/urandom # /usr/sbin/rndc-confgen -a -r /dev/urandom
else # else
/usr/sbin/rndc-confgen -a # /usr/sbin/rndc-confgen -a
fi # fi
COUNT=`grep -c 'key "rndc-key"' $RNDCKEY` # COUNT=`grep -c 'key "rndc-key"' $RNDCKEY`
if [ "$COUNT" -eq 1 ]; then # if [ "$COUNT" -eq 1 ]; then
perl -pi -e 's/key "rndc-key"/key "rndckey"/' $RNDCKEY # perl -pi -e 's/key "rndc-key"/key "rndckey"/' $RNDCKEY
fi # fi
echo "Done generating new key"; # echo "Done generating new key";
fi # fi
if [ ! -s $RNDCKEY ]; then # if [ ! -s $RNDCKEY ]; then
echo "rndc-confgen failed. Using template instead."; # echo "rndc-confgen failed. Using template instead.";
wget -O $RNDCKEY http://www.directadmin.com/rndc.key # wget -O $RNDCKEY http://www.directadmin.com/rndc.key
if [ `cat $RNDCKEY | grep -c secret` -eq 0 ]; then # if [ `cat $RNDCKEY | grep -c secret` -eq 0 ]; then
SECRET=`/usr/sbin/rndc-confgen | grep secret | head -n 1` # SECRET=`/usr/sbin/rndc-confgen | grep secret | head -n 1`
STR="perl -pi -e 's#hmac-md5;#hmac-md5;\n\t$SECRET#' $RNDCKEY;" # STR="perl -pi -e 's#hmac-md5;#hmac-md5;\n\t$SECRET#' $RNDCKEY;"
eval $STR; # eval $STR;
fi # fi
echo "Template installed."; # echo "Template installed.";
fi # fi
chown named:named ${RNDCKEY} # chown named:named ${RNDCKEY}
fi # fi
if [ -e /etc/sysconfig/named ]; then # if [ -e /etc/sysconfig/named ]; then
/usr/bin/perl -pi -e 's/^ROOTDIR=.*/ROOTDIR=/' /etc/sysconfig/named # /usr/bin/perl -pi -e 's/^ROOTDIR=.*/ROOTDIR=/' /etc/sysconfig/named
fi # fi
if [ $SSL_DEVEL -eq 0 ]; then # if [ $SSL_DEVEL -eq 0 ]; then
echo ""; # echo "";
echo ""; # echo "";
echo "Cannot find ${SSL_H}."; # echo "Cannot find ${SSL_H}.";
echo "Did you run the pre-install commands?"; # echo "Did you run the pre-install commands?";
echo "http://help.directadmin.com/item.php?id=354"; # echo "http://help.directadmin.com/item.php?id=354";
echo ""; # echo "";
exit 12; # exit 12;
fi # fi
if [ $OS != "FreeBSD" ]; then if [ $OS != "FreeBSD" ]; then
groupadd apache >/dev/null 2>&1 groupadd apache >/dev/null 2>&1
@@ -597,7 +597,7 @@ if [ -x $DATE_BIN ]; then
echo "'$NOW' is not a valid integer. Check the '$DATE_BIN +%s' command"; echo "'$NOW' is not a valid integer. Check the '$DATE_BIN +%s' command";
fi fi
fi fi
touch /root/.skip_mysql_install
#setup a basic my.cnf file. #setup a basic my.cnf file.
MYCNF=/etc/my.cnf MYCNF=/etc/my.cnf
if [ ! -e /root/.skip_mysql_install ]; then if [ ! -e /root/.skip_mysql_install ]; then