sh my-first-bash-script-wp-cli.sh

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh my-first-bash-script-wp-cli.sh相关的知识,希望对你有一定的参考价值。

#!/bin/bash

#Double-check you're ready to rock and roll with an update
read -r -p "Are you sure you want to update all specified directories? [y/N] " response

	if [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]]; then

		#Set the array of folders
		DIRECTORIES=( 'wordpress-default' 'wordpress-develop' );

		#For each item in array, run the commands

		for dir in ${DIRECTORIES[@]} ; do

		  cd ${dir}/public_html;

		  echo "";
		  echo "";
		  echo "*****************************************************" ;
		  echo "UPDATING: " ${dir} " in " `pwd` ;
		  echo "*****************************************************" ;
		  echo "";
		  echo "";

		  wp theme update --all;
		  wp plugin update --all;
		  wp theme list;
		  wp plugin list;
		  wp core update;
		  wp checksum core;
		  wp db check;

		  echo '';
		  echo '';
		  echo "*****************************************************" ;
		  echo "UPDATE for ${dir} COMPLETE!" ;
		  echo "*****************************************************" ;
		  echo '';
		  echo '';

		  cd ../.. ;
		done

	fi

以上是关于sh my-first-bash-script-wp-cli.sh的主要内容,如果未能解决你的问题,请参考以下文章

sh sh_template.sh

sh sh.sh

Linux下面如何运行 SH文件

配置告警系统主脚本main.sh mon.sh load.sh 502.sh disk.sh

shell 脚本各种执行方式(source ./*.sh, . ./*.sh, ./*.sh)的区别

linux下sh文件的运行