Update n8n.sh (#7176)

This commit is contained in:
Slaviša Arežina 2025-08-25 14:11:26 +02:00 committed by GitHub
parent 941457b392
commit c6864c74bc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -27,13 +27,6 @@ function update_script() {
msg_error "No ${APP} Installation Found!" msg_error "No ${APP} Installation Found!"
exit exit
fi fi
if [[ "$(node -v | cut -d 'v' -f 2)" == "18."* ]]; then
if ! command -v npm >/dev/null 2>&1; then
echo "Installing NPM..."
$STD apt-get install -y npm
echo "Installed NPM..."
fi
fi
if [ ! -f /opt/n8n.env ]; then if [ ! -f /opt/n8n.env ]; then
sed -i 's|^Environment="N8N_SECURE_COOKIE=false"$|EnvironmentFile=/opt/n8n.env|' /etc/systemd/system/n8n.service sed -i 's|^Environment="N8N_SECURE_COOKIE=false"$|EnvironmentFile=/opt/n8n.env|' /etc/systemd/system/n8n.service
HOST_IP=$(hostname -I | awk '{print $1}') HOST_IP=$(hostname -I | awk '{print $1}')
@ -45,6 +38,7 @@ N8N_PROTOCOL=http
N8N_HOST=$HOST_IP N8N_HOST=$HOST_IP
EOF EOF
fi fi
NODE_VERSION="22" setup_nodejs
msg_info "Updating ${APP} LXC" msg_info "Updating ${APP} LXC"
$STD npm update -g n8n $STD npm update -g n8n