#!/bin/bash
# PXE 安装 ucloud & smartnic 
# start_pxe.sh

pid_file=/tmp/osinstall.pid
pid_check() {
    if [ -e $pid_file ]; then
        pid_check=`pgrep -F $pid_file`
        if [ -n "$pid_check" ] ;then
            echo "PID $pid_check is still running or pgrep check errored.$(date +%F_%T) Exiting."
            exit 1
        fi
    fi
}
pid_check

# 下载装机脚本 小系统的DNS指向KS机
wget -N http://softlib.service.ucloud.cn/usa/pangu2/scripts.tar -P /tmp/ && { /usr/bin/rm -rf /scripts/; tar xf /tmp/scripts.tar -C /; }

# 运行
bash -x /scripts/start.sh "$@"

