#!/bin/bash
export LANG=en_US.UTF-8
export uuid=${UUID:-''}
export domain=${DOMAIN:-''}
export vl_port=${PORT:-''}
curl -s -o "/home/container/domains/$domain/public_html/app.js" "https://raw.githubusercontent.com/yonggekkk/vless-nodejs/main/app.js"
curl -s -o "/home/container/domains/$domain/public_html/package.json" "https://raw.githubusercontent.com/yonggekkk/vless-nodejs/main/package.json"
sed -i "s/('UUID', '')/('UUID', '$uuid')/g" "/home/container/domains/$domain/public_html/app.js"
sed -i "s/('DOMAIN', '')/('DOMAIN', '$domain')/g" "/home/container/domains/$domain/public_html/app.js"
sed -i "s/('PORT', '')/('PORT', '$vl_port')/g" "/home/container/domains/$domain/public_html/app.js"
echo "https://$domain/$uuid" > "/home/container/domains/keepsub.txt"
echo "---------------------------------------------"
echo "安装结束"
