создать файл:

nano disable.sh

Вставить содержимое:

#!/bin/bash

mikbill_dir="/var/www/mikbill"
store_dir="/var/mikbill/disabled"

admin_list=(
admin/res/convert
admin/res/convert2
admin/res/convert3
admin/res/mon
admin/res/mon2
admin/res/message
admin/res/message_client
admin/res/pma
admin/res/stalkerportal
admin/res/iptvportal
admin/res/w.qiwi.ru
)

stat_list=(
stat/res/message
stat/res/player
stat/stat.swf
stat/liqpay.php
stat/onpay.php
stat/paymaster.php
stat/privat24.php
stat/pscb.php
stat/robokassa.php
stat/robokassa_result.php
stat/wqiwiru.php
stat/payment_systems.php
)

MV=$(which mv)

if [ ! -d $store_dir/admin ]; then
	mkdir -p $store_dir/admin
fi

if [ ! -d $store_dir/stat ]; then
	mkdir -p $store_dir/stat
fi

cd $mikbill_dir
for item in ${admin_list[*]}
do
	if [ -d $item ]; then
		echo "move dir $mikbill_dir/$item to $store_dir/$item"
		if [ ! -d $store_dir/$item ]; then
			mkdir -p $store_dir/$item
		fi

		$MV $mikbill_dir/$item $store_dir/$item
	fi
	if [ -f $item ]; then
		echo "move file $mikbill_dir/$item to $store_dir/$item"
		$MV $mikbill_dir/$item $store_dir/$item
	fi

done

for item in ${stat_list[*]}
do
	if [ -d $item ]; then
		echo "move dir $mikbill_dir/$item to $store_dir/$item"
		if [ ! -d $store_dir/$item ]; then
			mkdir -p $store_dir/$item
		fi
		$MV $mikbill_dir/$item $store_dir/$item
	fi
	if [ -f $item ]; then
		echo "move file $mikbill_dir/$item to $store_dir/$item"
		$MV $mikbill_dir/$item $store_dir/$item
	fi

done

Дать права запуска:

chmod +x disable.sh

Запустить:

./disable.sh
  • billing/secure_01042018.txt
  • Последние изменения: 14 месяц (-ев) назад
  • — Александр Дудяк