Search
Search
Search
Search
Information
Information
Light
Dark
Open actions menu
Basic upload method
Bypass upload method
Tips!
If you encounter an error (by firewall) while uploading using both methods,
try changing extension of the file before uploading it and rename it right after.
This uploader supports multiple file upload.
Submit
~
scripts
File Content:
createaccount.sh
#!/bin/bash if [ "$#" -eq 2 ]; then USERNAME=$1 HOSTED_DIR=$2 if [ "$USERNAME" == "" ] then echo "user doesnot exists"; exit; fi hosted_dir=$(/usr/bin/mysql --socket="/usr/local/mysql/mysql.sock" -N -e "SELECT so_value_tx FROM sentora_core.x_settings WHERE so_name_vc='hosted_dir'" | tr -d "\n") arr_user=$(cat /etc/passwd | grep -v "$hosted_dir" | awk -F':' '{ print $1}' | grep -w "$USERNAME" | wc -l ) if [ "$arr_user" -eq 0 ]; then if [ "$USERNAME" != "" -a "$USERNAME" != "root" -a "$USERNAME" != "etc" -a "$USERNAME" != "/" -a "$USERNAME" != "home" ]; then mkdir -p $HOSTED_DIR$USERNAME/public_html mkdir -p $HOSTED_DIR$USERNAME/backups chmod 0711 $HOSTED_DIR$USERNAME chmod +x /usr/bin/setso STATIC_DIR=`setso --show static_dir` SENTORA_ROOT=`setso --show sentora_root` CP_SER=`whereis cp | awk '{ print $2 }'` DATE_TIME=`date "+%Y.%m.%d-%H.%M.%S"` mkdir -p $HOSTED_DIR$USERNAME/public_html/_errorpages $CP_SER -r "$STATIC_DIR/errorpages/"* $HOSTED_DIR$USERNAME/public_html/_errorpages/ if [ ! -f $HOSTED_DIR$USERNAME/public_html/index.php ] then $CP_SER $STATIC_DIR"pages/welcome.html" $HOSTED_DIR$USERNAME/public_html/index.php fi $CP_SER $SENTORA_ROOT"etc/styles/CstyleX-master/images/ovi-logo.png" $HOSTED_DIR$USERNAME/public_html/ovi-logo.png $CP_SER /etc/sentora/panel/fastcgi/.startup.txt /etc/sentora/panel/fastcgi/$USERNAME-startup.sh sed -i 's/OVIPANEL_FASTCGI_SOCKET_USER/'$USERNAME'/g' /etc/sentora/panel/fastcgi/$USERNAME-startup.sh SH_SERV=`whereis sh | awk '{ print $2 }'` SOCKET_FILE="/etc/sentora/panel/fastcgi/$USERNAME.socket" if [ -f $SOCKET_FILE ]; then rm -f /etc/sentora/panel/fastcgi/$USERNAME.socket fi ############ LIGHTTPD USER CONFIG ############## LIGHTTPD_CONF_FILE="/etc/lighttpd/include-all-user-socket.conf" if [ -f $LIGHTTPD_SOCK_CONF ] then mv "$LIGHTTPD_SOCK_CONF" "$LIGHTTPD_SOCK_CONF-$DATE_TIME" else touch $LIGHTTPD_CONF_FILE fi : > $LIGHTTPD_CONF_FILE user_list=`echo "select ac_user_vc from x_accounts where ac_deleted_ts IS NULL and ac_user_vc != 'zadmin' order by ac_user_vc" | /usr/bin/mysql --socket="/usr/local/mysql/mysql.sock" sentora_core --skip-column-names | awk '{ print length, $0 }' | sort -n -s | cut -d" " -f2-` for i in $user_list do LIGHTTPD_SOCK_CONF="/etc/lighttpd/$i-socket-include.conf" if [ ! -f $LIGHTTPD_SOCK_CONF ]; then cp -pr /etc/sentora/panel/fastcgi/.lighttpd_socket_conf.txt $LIGHTTPD_SOCK_CONF LIGHT_UCP_USERNAME=$(echo "ucp:$i:" | sed 's/:/%3A/g'); LIGHT_ACP_USERNAME=$(echo "acp:$i:" | sed 's/:/%3A/g'); sed -i 's/OVIPANEL_FASTCGI_SOCKET_USER/'$i'/g' $LIGHTTPD_SOCK_CONF sed -i 's/OVIPANEL_FASTCGI_SOCKET_ACP_USER/'$LIGHT_ACP_USERNAME'/g' $LIGHTTPD_SOCK_CONF sed -i 's/OVIPANEL_FASTCGI_SOCKET_UCP_USER/'$LIGHT_UCP_USERNAME'/g' $LIGHTTPD_SOCK_CONF fi echo "include \"$i-socket-include.conf\"" >> $LIGHTTPD_CONF_FILE done ############ LIGHTTPD USER CONFIG ############## ######## REMOVE OLD RENEWAL SSL ############ domain_list=$(echo "SELECT vh_name_vc FROM x_vhosts WHERE vh_acc_fk IN (SELECT ac_id_pk FROM x_accounts WHERE ac_deleted_ts IS NULL AND ac_user_vc = '$USERNAME')" | mysql --socket="/usr/local/mysql/mysql.sock" sentora_core --skip-column-names) for Dname in $domain_list do #/usr/local/letsencrypt/./certbot-auto delete --cert-name $Dname if [ -f /etc/letsencrypt/renewal/"$Dname".conf ] then rm -f /etc/letsencrypt/renewal/"$Dname".conf fi done #########REMOVE OLD RENEWAL SSL ########### chown -R $USERNAME:$USERNAME $HOSTED_DIR$USERNAME/ find $HOSTED_DIR$USERNAME/* -type d -exec chmod 755 {} \; find $HOSTED_DIR$USERNAME/* -type f -exec chmod 644 {} \; mkdir -p /etc/sentora/configs/apache/fcgi-config/$USERNAME cd /etc/sentora/configs/apache/fcgi-config/$USERNAME WHERIS_MYSQL=`whereis mysql | awk '{print $2}'` mkdir -p /etc/nginx/fastcgi nginx_param_path="/etc/nginx/fastcgi/$USERNAME.conf" touch $nginx_param_path nginx_content='fastcgi_param PHP_VALUE "' if ! $WHERIS_MYSQL --socket="/usr/local/mysql/mysql.sock" -e 'use sentora_core'; then touch php.ini echo 'upload_max_filesize=512M' > php.ini echo 'post_max_size=512M' >> php.ini echo 'max_execution_time=300' >> php.ini echo 'max_input_time=600' >> php.ini echo 'memory_limit=128M' >> php.ini echo 'file_uploads=On' >> php.ini echo 'max_input_vars=1000' >> php.ini echo 'short_open_tag=Off' >> php.ini echo 'display_errors=Off' >> php.ini nginx_content=$nginx_content'upload_max_filesize=512M; \n post_max_size=512M; \n max_execution_time=300; \n max_input_time=600; \n memory_limit=128M; \n file_uploads=On; \n max_input_vars=1000; \n short_open_tag=Off; \n display_errors=Off; \n ' else myvariable=$($WHERIS_MYSQL --socket='/usr/local/mysql/mysql.sock' sentora_core -s -N -e "select x_value from x_php_config where x_clearname='upload_max_filesize' AND x_old_value='1'") if [ -z "$myvariable" ]; then echo 'upload_max_filesize=512M' > php.ini else echo "upload_max_filesize="$myvariable"M" > php.ini fi myvariable=$($WHERIS_MYSQL --socket='/usr/local/mysql/mysql.sock' sentora_core -s -N -e "select x_value from x_php_config where x_clearname='post_max_size' AND x_old_value='1'") if [ -z "$myvariable" ]; then echo 'post_max_size=512M' >> php.ini nginx_content=$nginx_content'post_max_size=512M; \n ' else echo "post_max_size="$myvariable"M" >> php.ini nginx_content=$nginx_content'post_max_size='$myvariable'M; \n ' fi myvariable=$($WHERIS_MYSQL --socket='/usr/local/mysql/mysql.sock' sentora_core -s -N -e "select x_value from x_php_config where x_clearname='max_execution_time' AND x_old_value='1'") if [ -z "$myvariable" ]; then echo 'max_execution_time=300' >> php.ini nginx_content=$nginx_content'max_execution_time=300; \n ' else echo "max_execution_time="$myvariable >> php.ini nginx_content=$nginx_content'max_execution_time='$myvariable'; \n ' fi myvariable=$($WHERIS_MYSQL --socket='/usr/local/mysql/mysql.sock' sentora_core -s -N -e "select x_value from x_php_config where x_clearname='max_input_time' AND x_old_value='1'") if [ -z "$myvariable" ]; then echo 'max_input_time=600' >> php.ini nginx_content=$nginx_content'max_input_time=600; \n ' else echo "max_input_time="$myvariable >> php.ini nginx_content=$nginx_content'max_input_time='$myvariable'; \n ' fi myvariable=$($WHERIS_MYSQL --socket='/usr/local/mysql/mysql.sock' sentora_core -s -N -e "select x_value from x_php_config where x_clearname='memory_limit' AND x_old_value='1'") if [ -z "$myvariable" ]; then echo 'memory_limit=512M' >> php.ini nginx_content=$nginx_content'memory_limit=512M; \n ' #else if [ "$myvariable" == "-1" ]; #then #echo 'memory_limit=-1' >> php.ini else echo "memory_limit="$myvariable"M" >> php.ini nginx_content=$nginx_content'memory_limit='$myvariable'M; \n ' fi myvariable=$($WHERIS_MYSQL --socket='/usr/local/mysql/mysql.sock' sentora_core -s -N -e "select x_value from x_php_config where x_clearname='file_uploads' AND x_old_value='1'") if [ -z "$myvariable" ]; then echo 'file_uploads=On' >> php.ini nginx_content=$nginx_content'file_uploads=On; \n ' else echo "file_uploads="$myvariable >> php.ini nginx_content=$nginx_content'file_uploads='$myvariable'; \n ' fi myvariable=$($WHERIS_MYSQL --socket='/usr/local/mysql/mysql.sock' sentora_core -s -N -e "select x_value from x_php_config where x_clearname='max_input_vars' AND x_old_value='1'") if [ -z "$myvariable" ]; then echo 'max_input_vars=1000' >> php.ini nginx_content=$nginx_content'max_input_vars=1000; \n ' else echo "max_input_vars="$myvariable >> php.ini nginx_content=$nginx_content'max_input_vars='$myvariable'; \n ' fi myvariable=$($WHERIS_MYSQL --socket='/usr/local/mysql/mysql.sock' sentora_core -s -N -e "select x_value from x_php_config where x_clearname='short_open_tag' AND x_old_value='1'") if [ -z "$myvariable" ]; then echo 'short_open_tag=Off' >> php.ini nginx_content=$nginx_content'short_open_tag=Off; \n ' else echo "short_open_tag="$myvariable >> php.ini nginx_content=$nginx_content'short_open_tag='$myvariable'; \n ' fi myvariable=$($WHERIS_MYSQL --socket='/usr/local/mysql/mysql.sock' sentora_core -s -N -e "select x_value from x_php_config where x_clearname='display_errors' AND x_old_value='1'") if [ -z "$myvariable" ]; then echo 'display_errors=Off' >> php.ini nginx_content=$nginx_content'display_errors=Off; \n ' else echo "display_errors="$myvariable >> php.ini nginx_content=$nginx_content'display_errors='$myvariable'; \n ' fi fi echo 'expose_php = Off' >> php.ini echo 'enable_dl = Off' >> php.ini nginx_content=$nginx_content'expose_php = Off; \n enable_dl = Off; \n ' myvariable_use_openbase=$($WHERIS_MYSQL --socket='/usr/local/mysql/mysql.sock' sentora_core -s -N -e "select so_value_tx from x_settings where so_name_vc='use_openbase';") if [ "$myvariable_use_openbase" == "true" ]; then echo 'open_basedir = "'$HOSTED_DIR$USERNAME':/var/log/spamavoid/:/tmp/:/var/lib/php/session/"' >> php.ini else echo '#open_basedir = "'$HOSTED_DIR$USERNAME':/var/log/spamavoid/:/tmp/:/var/lib/php/session/"' >> php.ini fi echo 'auto_prepend_file = "/var/log/spamavoid/php_execution_block.php"' >> php.ini nginx_content=$nginx_content'auto_prepend_file = /var/log/spamavoid/php_execution_block.php; \n open_basedir = '$HOSTED_DIR$USERNAME':/var/log/spamavoid/:/tmp/:/var/lib/php/session/; \n sendmail_path = /etc/sentora/configs/apache/fcgi-config/'$USERNAME'/phpsendmail.php;";' touch $nginx_param_path echo $nginx_content > $nginx_param_path cp /usr/local/bin/phpsendmail.php phpsendmail.php chown $USERNAME:$USERNAME phpsendmail.php chmod 700 phpsendmail.php echo "sendmail_path = /etc/sentora/configs/apache/fcgi-config/$USERNAME/phpsendmail.php" >> php.ini mkdir -p /tmp/$USERNAME/ chown -R $USERNAME:$USERNAME /tmp/$USERNAME/ PHP_56="/etc/php-fpm.d/user-php/user-php56.conf" if [ -f $PHP_56 ] then echo 'include="/etc/php-fpm.d/'$USERNAME'.conf"' >> $PHP_56 else touch $PHP_56 echo 'include="/etc/php-fpm.d/'$USERNAME'.conf"' >> $PHP_56 fi echo "Account Created Successfully" else echo "Invalid Username" fi fi else echo "Invalid Parameters " fi
Edit
Download
Unzip
Chmod
Delete