Files
dao_hades/cradle/usr/local/bin/dao.sh
Jamie Albert e5d26bd32b Lazy commit
2025-11-06 02:30:35 +00:00

51 lines
936 B
Bash
Executable File

#!/usr/bin/env bash
# ---
# @file_name: dao.sh
# @version: 1.0.0
# @description: main dao handler
# @author: Jamie Albert (empty_produce)
# @author_contact: <mailto:empty.produce@flatmail.me>
# @license: GNU Affero General Public License v3.0 (Included in LICENSE)
# Copyright (C) 2025, Jamie Albert
# ---
set -euo pipefail
# ---
# shellcheck disable=1091
# ---
setup() {
. /usr/local/share/dao/libs/libs_dao.sh
. /usr/local/share/dao/config/dao.conf
}
declare -g COMMAND=$1
shift
main() {
setup
case "${COMMAND}" in
update)
"${DAO_SCRIPTS_DIR}/on_demand/update.sh" "$@"
;;
transfer)
"${DAO_SCRIPTS_DIR}/on_demand/transfer.sh" "$@"
;;
pwgen)
"${DAO_SCRIPTS_DIR}/on_demand/pwgen.sh" "$@"
;;
mount)
"${DAO_SCRIPTS_DIR}/always/mount.sh" "$@"
;;
firewall)
"${DAO_SCRIPTS_DIR}/reboot/firewall.sh" "$@"
;;
*)
echo "Usage: dao {update|transfer|pwgen|mount|firewall} [args]"
exit 1
;;
esac
}
main "$@"