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
This commit is contained in:
0x1eef 2024-07-21 21:52:21 -03:00
parent c69b357a36
commit a0988e1463
2 changed files with 0 additions and 77 deletions

View file

@ -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"

View file

@ -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