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/ drwxr-xr-x |
Viewing file: Select action/file-type: #!/bin/bash dir=$1 dir_etc=$dir"/etc" dir_usr=$dir"/usr" dir_var=$dir"/var" dir_etc=`echo $dir_etc | sed "s/\/\//\//g"` dir_usr=`echo $dir_usr | sed "s/\/\//\//g"` dir_var=`echo $dir_var | sed "s/\/\//\//g"` if [ "x$dir" = "x" ]; then echo "Usage: $0 [destination directory]" echo " For example: $0 /mnt/" exit -1 fi if [ ! -d $dir_etc ]; then echo "Direcory $dir_etc is missing, please check $dir" exit -1 fi if [ ! -d $dir_usr ]; then echo "Direcory $dir_usr is missing, please check $dir" exit -1 fi if [ ! -d $dir_var ]; then echo "Direcory $dir_var is missing, please check $dir" exit -1 fi echo "Starting rsync..." ### rsync process ### find /var/spool/postfix/hold/ -type f -mtime +2 -delete mv $dir_etc/mysql/conf.d/mysql-proxy $dir_etc/mysql/conf.d/mysql-proxy.h78 rsync -av /etc/awstats/ $dir_etc/awstats/ rsync -av /etc/postfix/ $dir_etc/postfix/ rsync -av /etc/dovecot/dovecot.passwd $dir_etc/dovecot/ rsync -av /etc/bind/ $dir_etc/bind/ rsync -av /etc/squirrelmail/config.php $dir_etc/squirrelmail/config.php rsync -av /etc/apache2/apache2.conf $dir_etc/apache2/apache2.conf rsync -av /etc/apache2/mods-available/rpaf.conf $dir_etc/apache2/mods-available/rpaf.conf rsync -av /etc/apache2/mods-enabled/rpaf.conf $dir_etc/apache2/mods-enabled/rpaf.conf rsync -av /etc/nginx/nginx.conf $dir_etc/nginx/nginx.conf rsync -av /etc/network/interfaces $dir_etc/network/interfaces rsync -av /etc/php5/cgi/php.ini $dir_etc/php52/cgi/php.ini rsync -av /etc/xinetd.d/mysql $dir_etc/xinetd.d/mysql rsync -av /etc/mysql/conf.d/mysql-proxy $dir_etc/mysql/conf.d/mysql-proxy rsync -av /usr/local/ispmgr/etc/ispmgr.conf $dir_usr/local/ispmgr/etc/ispmgr.conf rsync -av /usr/local/ispmgr/etc/rotate.conf $dir_usr/local/ispmgr/etc/rotate.conf rsync -avc /usr/local/ispmgr/etc/ispmgr.inc $dir_usr/local/ispmgr/etc/ispmgr.inc rsync -av /usr/local/ispmgr/etc/ispmgr.lic $dir_usr/local/ispmgr/etc/ispmgr.lic rsync -av /usr/local/ispmgr/etc/*email $dir_usr/local/ispmgr/etc/ rsync -av --delete /usr/local/ispmgr/var/userconf/ $dir_usr/local/ispmgr/var/userconf/ rsync -av --delete /usr/local/ispmgr/var/usernote/ $dir_usr/local/ispmgr/var/usernote/ rsync -av /usr/local/ispmgr/var/httpd-acct.log $dir_usr/local/ispmgr/var/httpd-acct.log rsync -av /usr/local/ispmgr/var/ispmgr.lang.stat $dir_usr/local/ispmgr/var/ rsync -av /usr/local/ispmgr/addon/rbackup.conf.php $dir_usr/local/ispmgr/addon/ rsync -av /var/log/account/ $dir_var/log/account/ rm -r $dir_var/spool/postfix rsync -av /var/spool/postfix $dir_var/spool/ cd /etc/ rsync -av aliases* group* passwd* shadow* hostname hosts $dir_etc/ hostname -f > $dir_etc/mailname rsync -a /etc/mail/ $dir_etc/mail/ rsync -a /var/spool/cron/crontabs/ $dir_var/spool/cron/crontabs --exclude="*root*" rsync -a /var/spool/squirrelmail/ $dir_var/spool/squirrelmail/ rsync -a /var/lib/squirrelmail/ $dir_var/lib/squirrelmail/ rsync -a /var/ftp $dir_var/ echo "Fixing home directories..." cd $dir_usr/local/ispmgr/etc/home.skel/ for i in `cat /etc/passwd | grep "/data:" | awk -F':' '{print $1}'`; do if [ -d /home/$i/data ]; then mv /home/$i/data/php-bin /home/$i/data/php53-bin rsync -a php-bin php52-bin php53-bin /home/$i/data/ mv /home/$i/data/php4-bin /home/$i/data/php4-bin.deprecated if [ ! -f "/home/$i/data/php-bin/php.ini" ]; then cp -ax /home/$i/data/php53-bin/php.ini /home/$i/data/php-bin/; fi if [ ! -f "/home/$i/data/php52-bin/php.ini" ]; then cp -ax /home/$i/data/php53-bin/php.ini /home/$i/data/php52-bin/; fi chown $i:$i /home/$i/data/php52-bin /home/$i/data/php-bin /home/$i/data/php53-bin /home/$i/data/php52-bin/* /home/$i/data/php-bin/* /home/$i/data/php53-bin/* fi done echo "Preparing php52..." echo > $dir_usr/local/ispmgr/etc/wwwphpversion.inc for w in `cat /etc/apache2/apache2.conf | grep "<Directory " | awk '{print $2}' | awk -F'>' '{print $1}' | grep www | sort | uniq `; do d=`echo $w | awk -F'/www/' '{print $1}'` all=`cat /usr/local/ispmgr/etc/wwwphpversion.inc` if [ -d $d"/php52-bin" ]; then ttt=`echo "$all" | grep $d | grep .` if [ "x$ttt" = "x" ]; then echo "<Directory $w> #level=5 #php=php53 FCGIWrapper $d/php53-bin/php .php FCGIWrapper $d/php53-bin/php .php3 FCGIWrapper $d/php53-bin/php .php4 FCGIWrapper $d/php53-bin/php .php5 FCGIWrapper $d/php53-bin/php .phtml Options +ExecCGI </Directory>" >> $dir_usr/local/ispmgr/etc/wwwphpversion.inc else echo "<Directory $w> #level=5 #php=php52 FCGIWrapper $d/php52-bin/php .php FCGIWrapper $d/php52-bin/php .php3 FCGIWrapper $d/php52-bin/php .php4 FCGIWrapper $d/php52-bin/php .php5 FCGIWrapper $d/php52-bin/php .phtml Options +ExecCGI </Directory>" >> $dir_usr/local/ispmgr/etc/wwwphpversion.inc fi fi done chgrp postdrop $dir_usr/sbin/postdrop $dir_usr/sbin/postqueue chmod g+s $dir_usr/sbin/postdrop $dir_usr/sbin/postqueue touch $dir_etc/apache2/httpd.conf chown mysql:mysql $dir_var/log/mysql-proxy $dir_var/log/mysql-proxy/* $dir_var/log/mysql* chown clamav:clamav $dir_var/log/clamav chown clamav:adm $dir_var/log/clamav/* chown -R postfix:postfix $dir_var/lib/postfix #echo "Starting quota stuff" #quotaoff -a #mv /home/aquota.group /home/aquota.group.upgrade #mv /home/aquota.user /home/aquota.user.upgrade #echo "" #echo "==========================" #echo "WARNING: please run next commands after reboot to new system:" #echo "######## #quotaoff -a #cp -ax /home/aquota.group.upgrade /home/aquota.group #cp -ax /home/aquota.user.upgrade /home/aquota.user #quotacheck -vmug /home #quotaon /home #killall ispmgr #########" #echo "==========================" #echo "" sed -i.bak -e 's/^\(magic_quotes_gpc\|register_long_arrays\|allow_call_time_pass_reference\)/;\1/' /home/hvosting/data/php-bin/php.ini sed -i.bak -e 's/\(sm_encode_html_special_chars ($string\))/\1, ENT_COMPAT | ENT_HTML401, $charset, true)/' $dir_usr/share/squirrelmail/functions/i18n.php sed -i.bak -e 's/^\(<\/\?IfModule\)/#\1/i' $dir_etc/apache2/mods-enabled/rpaf.conf sed -i.bak -e '1506a\ if ( $encoding == "KOI8-U" )\n {\n $encoding = "KOI8-R";\n }\n' /usr/share/squirrelmail/functions/strings.php echo "All done exiting..." |
:: Command execute :: | |
--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by PinoyWH1Z | C99Shell Github | Generation time: 0.0387 ]-- |