From a0988e14639ab99366ac401d54956d8bcd3a4d18 Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Sun, 21 Jul 2024 21:52:21 -0300 Subject: [PATCH] Remove setup-cron I'm not sure about this feature, and since it hasn't been released yet, I'd prefer not to include it --- bin/setup-portzap | 1 - libexec/portzap/setup/setup-cron | 76 -------------------------------- 2 files changed, 77 deletions(-) delete mode 100644 libexec/portzap/setup/setup-cron diff --git a/bin/setup-portzap b/bin/setup-portzap index f720ec3..64c5eb3 100755 --- a/bin/setup-portzap +++ b/bin/setup-portzap @@ -29,7 +29,6 @@ else fi "${libexec}"/setup/setup-doas -"${libexec}"/setup/setup-cron echo echo "If you haven't already, add users to the _portzap group: " echo "root@$(hostname)# pw groupmod -n _portzap -m user1,user2" diff --git a/libexec/portzap/setup/setup-cron b/libexec/portzap/setup/setup-cron deleted file mode 100644 index e7029f7..0000000 --- a/libexec/portzap/setup/setup-cron +++ /dev/null @@ -1,76 +0,0 @@ -#!/bin/sh -set -e - -## -# variables -user="_portzap" -localbase=$(realpath "$(dirname "$0")"/../../..) -libexec="${localbase}"/libexec/portzap -sharedir="${localbase}"/share/portzap - -## -# functions -. "${libexec}"/functions/print.sh - -verify_allowfile() -{ - allowfile="/var/cron/allow" - if [ -e "${allowfile}" ]; then - if grep -Eqe "^${user}$" "${allowfile}"; then - printok "${user} found in ${allowfile}" - else - printerr "add ${user} to ${allowfile} in order to proceed" - exit 1 - fi - else - printok "${allowfile} not found" - fi -} - -verify_denyfile() -{ - denyfile="/var/cron/deny" - if [ -e "${denyfile}" ]; then - if grep -Eqe "^${user}$" "${denyfile}"; then - printerr "remove ${user} from ${denyfile} in order to proceed" - exit 1 - else - printok "${user} not found in ${denyfile}" - fi - else - printok "${denyfile} not found" - fi -} - -install_crontab() -{ - src="${sharedir}/crontab" - dest="/var/cron/tabs/${user}" - if [ -e "${dest}" ]; then - yes | crontab -u "${user}" -r - printok "crontab removed (${dest})" - fi - crontab -u "${user}" "${src}" - chmod u=rw,g=,o= "${dest}" - printok "crontab installed (${dest})" -} - -## -# main -echo -n "configure portzap to run via cron(8) ? yes or no: " -while read -r r; do - case "${r}" in - yes|YES) - verify_allowfile - verify_denyfile - install_crontab - break - ;; - no|NO) - break - ;; - *) - echo -n "yes or no: " - ;; - esac -done