Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #一次更新主機上所有網站的某一個外掛或佈景主題(需安裝WP-CLI)
- #By Jack https://www.yogoeasy.com
- read -p "更新外掛請輸入1,更新主題請輸入2: " isPlugin
- read -p "輸入更新項目的資料夾名稱(例如:Yoast SEO要輸入wordpress-seo): " name
- #name=wordpress-seo
- #isPlugin=1
- echo 'Upgrading'
- echo $name
- if (( $isPlugin == 1 ))
- then
- cd /var/www
- for i in * ;
- do
- echo $i
- ls /var/www/$i/htdocs/wp-content/plugins/$name && cd $_ && wp plugin update $name --allow-root
- done
- else
- cd /var/www
- for i in * ;
- do
- echo $i
- ls /var/www/$i/htdocs/wp-content/themes/$name && cd $_ && wp theme update $name --allow-root
- done
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement