wordpress-tools/install.sh
2022-08-22 14:01:24 -07:00

33 lines
991 B
Bash
Executable File

#!/bin/bash
#
# wordpress-tools
# https://git.stack-source.com/msb/wordpress-tools
# Copyright (c) 2022 Matthew Saunders Brown <matthewsaundersbrown@gmail.com>\
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
if [ "${EUID}" -ne 0 ]; then
echo "You must be root to run this installer."
exit
fi
# download & install wp-cli
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
sudo mv wp-cli.phar /usr/local/bin/wp
chmod +x /usr/local/bin/wp
# configure wp-cli bash completion
cp bash_completion.d/wp-cli /etc/bash_completion.d/
chmod 644 /etc/bash_completion.d/wp-cli
# install wp user scripts
cp bin/wp-* /usr/local/bin
chmod 755 /usr/local/bin/wp-*
# install & enable wp systemd cron
cp sbin/wp-cron.sh /usr/local/sbin/
chmod 755 /usr/local/sbin/wp-cron.sh
cp systemd/wp-cron.* /usr/lib/systemd/system/
chmod 644 /usr/lib/systemd/system/wp-cron.*
systemctl enable wp-cron.timer
systemctl start wp-cron.timer