Updated Install Flow

This commit is contained in:
Michel Roegl-Brunner 2026-01-26 13:29:32 +01:00
parent 327b8b531f
commit ef7d1927c5
2 changed files with 22 additions and 34 deletions

View File

@ -24,12 +24,11 @@ function update_script() {
check_container_storage check_container_storage
check_container_resources check_container_resources
if [[ ! -d /opt/clawdbot ]]; then if ! command -v clawdbot >/dev/null 2>&1; then
msg_error "No ${APP} Installation Found!" msg_error "No ${APP} Installation Found!"
exit exit
fi fi
if check_for_gh_release "clawdbot" "clawdbot/clawdbot"; then
msg_info "Stopping Service" msg_info "Stopping Service"
systemctl stop clawdbot systemctl stop clawdbot
msg_ok "Stopped Service" msg_ok "Stopped Service"
@ -39,12 +38,9 @@ function update_script() {
cp -r /root/.clawdbot /root/.clawdbot_backup 2>/dev/null || true cp -r /root/.clawdbot /root/.clawdbot_backup 2>/dev/null || true
msg_ok "Backed up Data" msg_ok "Backed up Data"
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "clawdbot" "clawdbot/clawdbot" msg_info "Updating Clawdbot"
$STD npm install -g clawdbot@latest
msg_info "Rebuilding Application" msg_ok "Updated Clawdbot"
cd /opt/clawdbot
$STD npm install
msg_ok "Rebuilt Application"
msg_info "Restoring Data" msg_info "Restoring Data"
cp -r /opt/clawdbot_data_backup/. /opt/clawdbot/data 2>/dev/null || true cp -r /opt/clawdbot_data_backup/. /opt/clawdbot/data 2>/dev/null || true
@ -56,7 +52,6 @@ function update_script() {
systemctl start clawdbot systemctl start clawdbot
msg_ok "Started Service" msg_ok "Started Service"
msg_ok "Updated successfully!" msg_ok "Updated successfully!"
fi
exit exit
} }

View File

@ -19,16 +19,9 @@ $STD apt-get install -y \
git git
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
NODE_VERSION="24" setup_nodejs NODE_VERSION="24" NODE_MODULE="clawdbot@latest" setup_nodejs
import_local_ip import_local_ip
fetch_and_deploy_gh_release "clawdbot" "clawdbot/clawdbot"
msg_info "Installing Clawdbot"
cd /opt/clawdbot
$STD npm install
msg_ok "Installed Clawdbot"
msg_info "Configuring Clawdbot" msg_info "Configuring Clawdbot"
mkdir -p /opt/clawdbot/data mkdir -p /opt/clawdbot/data
cat <<EOF >/opt/clawdbot/.env cat <<EOF >/opt/clawdbot/.env
@ -49,7 +42,7 @@ Type=simple
User=root User=root
WorkingDirectory=/opt/clawdbot WorkingDirectory=/opt/clawdbot
EnvironmentFile=/opt/clawdbot/.env EnvironmentFile=/opt/clawdbot/.env
ExecStart=/usr/bin/npm start ExecStart=/usr/bin/clawdbot
Restart=on-failure Restart=on-failure
RestartSec=5 RestartSec=5