#!/bin/bash

if [ ! -e /usr/bin/nmap ]; then
    apt update
    apt install nmap	
fi

ipc_path=/home/pi/ipc
rm -rf "${ipc_path}"
mkdir "${ipc_path}"
chmod 777 "${ipc_path}"
cd "${ipc_path}"

#获取启动脚本  服务脚本
curl -o ipc.sh "https://local.vrmaker.vip:1443/ipc/ipc.sh"
curl -O "https://local.vrmaker.vip:1443/ipc/ipc.service"

# 赋予执行权限
chmod 777 ipc.service
chmod 777 ipc.sh

rm -f /etc/systemd/system/ipc.service

cp ipc.service /etc/systemd/system/

# 安装服务
systemctl disable ipc.service
systemctl enable ipc.service

# java 命令软链接
if [ ! -e /usr/local/bin/java ];then
	ln -s "${JAVA_HOME}/bin/java" /usr/local/bin/
fi

