#!/bin/bash
# bash -c "$(curl -fsSL http://omega.2401pt.com/download/mcsm_bootstrap.sh)"
set -e
set -x 
echo "别问，问就是方便省事"
echo "更新一下软件源和软件包"
sudo apt update -yq 
# sudo apt upgrade -yq 不更新了，太费时
echo "安装 node 14+"
wget -O node16.tar.xz https://npmmirror.com/mirrors/node/v16.18.1/node-v16.18.1-linux-x64.tar.xz && \
tar -xf node16.tar.xz && rm node16.tar.xz
echo "export PATH=$PATH:$PWD/node-v16.18.1-linux-x64/bin/" >> ~/.bashrc && source ~/.bashrc
echo "安装mcsm"
wget -O mcsm-setup.sh https://gitee.com/mcsmanager/script/raw/master/setup.sh && sudo bash mcsm-setup.sh #&& rm  mcsm-setup.sh
echo "准备omega镜像"
mkdir -p $PWD/omega_docker && wget -O $PWD/omega_docker/dockerfile http://omega.2401pt.com/download/dockerfile && sudo docker build omega_docker -t omega:latest
clear 
echo "好了，全部完成啦"