diff --git a/ct/whodb.sh b/ct/whodb.sh new file mode 100644 index 000000000..dc1770f37 --- /dev/null +++ b/ct/whodb.sh @@ -0,0 +1,54 @@ +#!/usr/bin/env bash +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +# Copyright (c) 2021-2026 community-scripts ORG +# Author: MickLesk (CanbiZ) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://whodb.com/ + +APP="WhoDB" +var_tags="${var_tags:-database;management;gui}" +var_cpu="${var_cpu:-1}" +var_ram="${var_ram:-512}" +var_disk="${var_disk:-2}" +var_os="${var_os:-debian}" +var_version="${var_version:-13}" +var_unprivileged="${var_unprivileged:-1}" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + + if [[ ! -f /opt/whodb/whodb ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + + if check_for_gh_release "whodb" "clidey/whodb"; then + msg_info "Stopping Service" + systemctl stop whodb + msg_ok "Stopped Service" + + fetch_and_deploy_gh_release "whodb" "clidey/whodb" "singlefile" "latest" "/opt/whodb" "whodb-*-linux-amd64" + + msg_info "Starting Service" + systemctl start whodb + msg_ok "Started Service" + msg_ok "Updated successfully!" + fi + exit +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" +echo -e "${INFO}${YW} Access it using the following URL:${CL}" +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8080${CL}" diff --git a/install/whodb-install.sh b/install/whodb-install.sh new file mode 100644 index 000000000..78e7ef802 --- /dev/null +++ b/install/whodb-install.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2026 community-scripts ORG +# Author: MickLesk (CanbiZ) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://whodb.com/ + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +fetch_and_deploy_gh_release "whodb" "clidey/whodb" "singlefile" "latest" "/opt/whodb" "whodb-*-linux-amd64" + +msg_info "Creating Service" +cat </etc/systemd/system/whodb.service +[Unit] +Description=WhoDB Database Management +After=network.target + +[Service] +Type=simple +User=root +WorkingDirectory=/opt/whodb +ExecStart=/opt/whodb/whodb +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now whodb +msg_ok "Created Service" + +motd_ssh +customize +cleanup_lxc