This commit is contained in:
chaos-zhu 2022-06-09 14:26:15 +08:00
parent 138a3d3405
commit c9a8fbd0f0
3 changed files with 9 additions and 10 deletions

View File

@ -1,7 +1,7 @@
#!/bin/bash
if [ "$(id -u)" != "0" ] ; then
echo "***********************需root权限***********************"
echo "***********************请切换到root再尝试执行***********************"
exit 1
fi
@ -63,24 +63,23 @@ fi
echo "***********************下载成功***********************"
echo "***********************设置权限***********************"
# echo "***********************设置权限***********************"
chmod +x ${FILE_PATH}/${SERVER_NAME}
chmod 777 ${FILE_PATH}/${SERVER_NAME}.service
echo "***********************移动service&reload***********************"
# echo "***********************移动service&reload***********************"
mv ${FILE_PATH}/${SERVER_NAME}.service ${SERVICE_PATH}
echo "***********************daemon-reload***********************"
# echo "***********************daemon-reload***********************"
systemctl daemon-reload
echo "***********************启动服务***********************"
systemctl start ${SERVER_NAME}
echo "***********************设置开机启动***********************"
# echo "***********************设置开机启动***********************"
systemctl enable ${SERVER_NAME}
echo "***********************完成安装并启动***********************"
echo "***********************安装成功***********************"
echo "***********************删除脚本***********************"
rm $0

View File

@ -1,7 +1,7 @@
#!/usr/bin/env bash
if [ "$(id -u)" != "0" ] ; then
echo "***********************需root权限***********************"
echo "***********************请切换到root再尝试执行***********************"
exit 1
fi
@ -30,5 +30,5 @@ fi
echo "*********************** 卸载完成 ***************************"
echo "***********************删除脚本***********************"
# echo "***********************删除脚本***********************"
rm "$0"

View File

@ -1,7 +1,7 @@
#!/bin/bash
if [ "$(id -u)" != "0" ] ; then
echo "***********************需root权限***********************"
echo "***********************请切换到root再尝试执行***********************"
exit 1
fi