32 lines
854 B
Plaintext
32 lines
854 B
Plaintext
# !/bin/bash
|
|
# 安装后执行脚本
|
|
RootDir=/usr/local/etc/omc
|
|
|
|
# 执行安装后配置
|
|
echo ""
|
|
echo "Output: $RootDir"
|
|
echo "Please Run:"
|
|
echo " sudo systemctl start|stop|status|restart omc.service"
|
|
echo ""
|
|
|
|
# 检查是否是第一次安装或是升级
|
|
if [ ! -f $RootDir/omc.yaml ]; then
|
|
# 第一次安装,执行相关操作
|
|
chmod +rx /usr/local/bin/omc
|
|
cp $RootDir/default/omc.conf $RootDir/omc.conf
|
|
cp $RootDir/default/omc.yaml $RootDir/omc.yaml
|
|
cp $RootDir/default/sshsvc.yaml $RootDir/sshsvc.yaml
|
|
|
|
systemctl daemon-reload
|
|
systemctl enable omc.service
|
|
systemctl enable sshsvc.service
|
|
systemctl daemon-reload
|
|
systemctl restart omc.service
|
|
systemctl restart sshsvc.service
|
|
else
|
|
# 升级时的操作
|
|
systemctl daemon-reload
|
|
systemctl start omc.service
|
|
systemctl start sshsvc.service
|
|
fi
|