Update setup scripts

This commit is contained in:
0x1eef 2024-07-21 21:59:36 -03:00
parent a0988e1463
commit 3e76bda8bd
2 changed files with 15 additions and 20 deletions

View file

@ -12,11 +12,7 @@ libexec="${localbase}"/libexec/portzap
## ##
# main # main
if [ "$(id -u)" != "0" ]; then if [ "$(id -u)" = "0" ]; then
printerr "you must be root"
exit 1
fi
if id -u _portzap > /dev/null 2>&1; then if id -u _portzap > /dev/null 2>&1; then
printok "_portzap user exists" printok "_portzap user exists"
else else
@ -27,9 +23,8 @@ else
chmod u=rwX,g=rX,o= /home/_portzap/ chmod u=rwX,g=rX,o= /home/_portzap/
printok "_portzap user created" printok "_portzap user created"
fi fi
"${libexec}"/setup/setup-doas "${libexec}"/setup/setup-doas
echo else
echo "If you haven't already, add users to the _portzap group: " printerr "you must be root"
echo "root@$(hostname)# pw groupmod -n _portzap -m user1,user2" exit 1
echo fi

View file

@ -16,10 +16,10 @@ install_doasconf()
src="${sharedir}/doas.conf" src="${sharedir}/doas.conf"
dest="${localbase}/etc/doas.conf" dest="${localbase}/etc/doas.conf"
if grep -Fq "$(cat "${src}")" "${dest}"; then if grep -Fq "$(cat "${src}")" "${dest}"; then
printok "doas.conf looks up to date" printok "doas.conf is up to date"
else else
cat "${src}" >> "${dest}" cat "${src}" >> "${dest}"
printok "${dest} has been updated" printok "${dest} updated"
fi fi
} }