Compare commits
3 commits
1822c14e63
...
9db88b16b1
Author | SHA1 | Date | |
---|---|---|---|
9db88b16b1 | |||
eca5d5585d | |||
bf7cc3627e |
10 changed files with 22 additions and 18 deletions
2
Makefile
2
Makefile
|
@ -17,4 +17,4 @@ deinstall:
|
|||
rm -rf $(SHAREDIR)
|
||||
|
||||
shellcheck:
|
||||
find bin/ libexec/ -type f -exec shellcheck "{}" \;
|
||||
find bin/ libexec/ -type f -exec shellcheck -x "{}" \;
|
||||
|
|
|
@ -13,6 +13,7 @@ revfile="${installdir}"/.portzap
|
|||
|
||||
##
|
||||
# functions
|
||||
# shellcheck source=/dev/null
|
||||
. "${libexec}"/functions/print.sh
|
||||
|
||||
require_dependency()
|
||||
|
|
|
@ -8,6 +8,7 @@ libexec="${localbase}"/libexec/portzap
|
|||
|
||||
##
|
||||
# functions
|
||||
# shellcheck source=/dev/null
|
||||
. "${libexec}"/functions/print.sh
|
||||
|
||||
##
|
||||
|
|
|
@ -11,6 +11,7 @@ branch=$2
|
|||
|
||||
##
|
||||
# functions
|
||||
# shellcheck source=/dev/null
|
||||
. "${libexec}"/functions/print.sh
|
||||
|
||||
##
|
||||
|
|
|
@ -12,6 +12,7 @@ branch=$3
|
|||
|
||||
##
|
||||
# functions
|
||||
# shellcheck source=/dev/null
|
||||
. "${libexec}"/functions/print.sh
|
||||
|
||||
##
|
||||
|
@ -34,5 +35,5 @@ fi
|
|||
"${git}" clone "${giturl}" "${gitdir}"
|
||||
cd "${gitdir}"
|
||||
"${git}" config core.filemode off
|
||||
"${git}" checkout -t origin/"${branch}" || true
|
||||
"${git}" checkout -t origin/"${branch}" > /dev/null 2>&1 || true
|
||||
printok "clone complete"
|
||||
|
|
|
@ -13,6 +13,7 @@ revfile=$3
|
|||
|
||||
##
|
||||
# functions
|
||||
# shellcheck source=/dev/null
|
||||
. "${libexec}"/functions/print.sh
|
||||
|
||||
perform_update()
|
||||
|
|
|
@ -10,6 +10,7 @@ gitdir=$1
|
|||
|
||||
##
|
||||
# functions
|
||||
# shellcheck source=/dev/null
|
||||
. "${libexec}"/functions/print.sh
|
||||
|
||||
##
|
||||
|
|
|
@ -10,6 +10,7 @@ installdir=$2
|
|||
|
||||
##
|
||||
# functions
|
||||
# shellcheck source=/dev/null
|
||||
. "${libexec}"/functions/print.sh
|
||||
|
||||
erase()
|
||||
|
|
|
@ -4,25 +4,21 @@ set -e
|
|||
##
|
||||
# variables
|
||||
localbase=$(realpath "$(dirname "$0")"/../../..)
|
||||
libexec="${localbase}/libexec/portzap"
|
||||
sharedir="${localbase}/share/portzap"
|
||||
libexec="${localbase}"/libexec/portzap
|
||||
sharedir="${localbase}"/share/portzap
|
||||
|
||||
##
|
||||
# functions
|
||||
# shellcheck source=/dev/null
|
||||
. "${libexec}"/functions/print.sh
|
||||
|
||||
install_doasconf()
|
||||
{
|
||||
src="${sharedir}/doas.conf"
|
||||
dest="${localbase}/etc/doas.conf"
|
||||
if grep -Fq "$(cat "${src}")" "${dest}"; then
|
||||
printok "doas.conf is up to date"
|
||||
else
|
||||
cat "${src}" >> "${dest}"
|
||||
printok "${dest} updated"
|
||||
fi
|
||||
}
|
||||
|
||||
##
|
||||
# main
|
||||
install_doasconf
|
||||
src="${sharedir}"/doas.conf
|
||||
dest="${localbase}"/etc/doas.conf
|
||||
if grep -Fq "$(cat "${src}")" "${dest}"; then
|
||||
printok "doas.conf is up to date"
|
||||
else
|
||||
cat "${src}" >> "${dest}"
|
||||
printok "${dest} updated"
|
||||
fi
|
||||
|
|
|
@ -9,6 +9,7 @@ user="_portzap"
|
|||
|
||||
##
|
||||
# functions
|
||||
# shellcheck source=/dev/null
|
||||
. "${libexec}"/functions/print.sh
|
||||
|
||||
##
|
||||
|
@ -16,7 +17,7 @@ user="_portzap"
|
|||
if id -u "${user}" > /dev/null 2>&1; then
|
||||
printok "${user} user exists"
|
||||
else
|
||||
pw useradd
|
||||
pw useradd \
|
||||
-n "${user}" \
|
||||
-c "portzap user" \
|
||||
-m \
|
||||
|
|
Loading…
Reference in a new issue