Compare commits

..

2 Commits

Author SHA1 Message Date
Matthew Saunders Brown
0bdd62a7ae update script 2021-04-14 12:23:00 -07:00
Matthew Saunders Brown
a5be05b7a2 readme 2021-04-14 12:14:35 -07:00
2 changed files with 51 additions and 4 deletions

View File

@ -2,10 +2,10 @@
A couple of handy tools for virtualhost servers with wordpress sites.
bash completion for wp-cli
a systemd cron for running wp crons. individual sites don't have to set their own cron job or rely on lazy cron
wp-create-db-user-from-config.sh extracts DB config info from wp-config.php, useful for creating dbs & users for sites that are being migrated
wp-installer.sh automated wp installer
- bash completion for wp-cli
- systemd cron for running wp crons. Individual sites don't have to set their own cron job or rely on lazy cron.
- wp-create-db-user-from-config.sh extracts DB config info from wp-config.php, useful for creating dbs & users for sites that are being migrated.
- wp-installer.sh for performing new WordPress installs.
## Install
```

47
update.sh Executable file
View File

@ -0,0 +1,47 @@
#!/bin/bash
# update repo
git pull
# update scripts in bin
chmod 755 bin/*
readarray -t bin_script_array < <(ls -1 bin/)
for bin_script in "${bin_script_array[@]}"; do
if [ -f /usr/local/bin/$bin_script ]; then
if ! diff -q bin/$bin_script /usr/local/bin/$bin_script ; then
echo "Updating /usr/local/bin/$bin_script"
cp bin/$bin_script /usr/local/bin/$bin_script
echo
fi
else
echo "Adding new script /usr/local/bin/$bin_script"
cp bin/$bin_script /usr/local/bin/$bin_script
echo
fi
done
# check etc configs for diffs
readarray -t etc_configs_array < <(find etc/ -type f)
for etc_config in "${etc_configs_array[@]}"; do
if [ -f /$etc_config ]; then
if ! diff -q $etc_config /$etc_config ; then
echo To update run:
echo diff $etc_config /$etc_config
echo cp $etc_config /$etc_config
echo
fi
else
echo "Adding new config file /$etc_config"
cp $etc_config /$etc_config
echo
fi
done
# update libexec script
if ! diff -q libexec/vmail-quota-warning.sh /usr/libexec/vmail-quota-warning.sh ; then
cp libexec/vmail-quota-warning.sh /usr/libexec/vmail-quota-warning.sh
chmod 750 /usr/libexec/vmail-quota-warning.sh
chown dovecot:mail /usr/libexec/vmail-quota-warning.sh
echo "/usr/libexec/vmail-quota-warning.sh updated"
echo
fi