Lazy commit
This commit is contained in:
50
cradle/usr/local/bin/dao.sh
Executable file
50
cradle/usr/local/bin/dao.sh
Executable file
@@ -0,0 +1,50 @@
|
||||
#!/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 "$@"
|
||||
Reference in New Issue
Block a user