From 3422156801fefe8d09f770ec0bfbbfabb1a70b95 Mon Sep 17 00:00:00 2001 From: Matthew Saunders Brown Date: Thu, 20 Oct 2022 11:51:42 -0700 Subject: [PATCH] install systemd configs in /usr/local/lib/systemd/system/ --- install.sh | 7 +++++-- update.sh | 12 ++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/install.sh b/install.sh index 27ba2a9..6362976 100755 --- a/install.sh +++ b/install.sh @@ -26,7 +26,10 @@ 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.* +if [[ ! -d /usr/local/lib/systemd/system ]]; then + mkdir -p /usr/local/lib/systemd/system +fi +cp systemd/wp-cron.* /usr/local/lib/systemd/system/ +chmod 644 /usr/local/lib/systemd/system/wp-cron.* systemctl enable wp-cron.timer systemctl start wp-cron.timer diff --git a/update.sh b/update.sh index 6146c23..a3d3fcc 100755 --- a/update.sh +++ b/update.sh @@ -47,15 +47,15 @@ if ! diff -q sbin/wp-cron.sh /usr/local/sbin/wp-cron.sh ; then fi # check systemd timer for update -if ! diff -q systemd/wp-cron.service /usr/lib/systemd/system/wp-cron.service ; then - cp systemd/wp-cron.service /usr/lib/systemd/system/wp-cron.service - chmod 644 /usr/lib/systemd/system/wp-cron.service +if ! diff -q systemd/wp-cron.service /usr/local/lib/systemd/system/wp-cron.service ; then + cp systemd/wp-cron.service /usr/local/lib/systemd/system/wp-cron.service + chmod 644 /usr/local/lib/systemd/system/wp-cron.service echo "systemd/wp-cron.service updated" echo fi -if ! diff -q systemd/wp-cron.timer /usr/lib/systemd/system/wp-cron.timer ; then - cp systemd/wp-cron.timer /usr/lib/systemd/system/wp-cron.timer - chmod 644 /usr/lib/systemd/system/wp-cron.timer +if ! diff -q systemd/wp-cron.timer /usr/local/lib/systemd/system/wp-cron.timer ; then + cp systemd/wp-cron.timer /usr/local/lib/systemd/system/wp-cron.timer + chmod 644 /usr/local/lib/systemd/system/wp-cron.timer echo "systemd/wp-cron.timer updated" echo fi