portzap/bin/portzap
2023-03-25 05:44:21 -03:00

45 lines
961 B
Bash
Executable file

#!/bin/sh
# Variables
ports_url="https://git.hardenedbsd.org/hardenedbsd/ports.git"
ports_dir="/usr/ports/"
portzap_file="$ports_dir/.portzap"
portzap_dir="/home/_portzap/ports"
libexec_dir=$(realpath $(dirname $0)/../libexec/portzap/)
# Masks
clone_mask=007
pull_mask=007
# Commands
. $libexec_dir/commands/install
. $libexec_dir/commands/pull
. $libexec_dir/commands/clone
# Functions
. $libexec_dir/functions/requirements.sh
case $1 in
"clone")
require_deps git
require_group _portzap
clone $portzap_dir $ports_url $clone_mask
break
;;
"pull")
require_deps git
require_group _portzap
pull $portzap_dir $pull_mask
break
;;
"install")
require_root
require_deps git
install $ports_dir $portzap_dir $libexec_dir $portzap_file
break
;;
*)
echo "Usage: portzap clone|pull|install"
break
;;
esac