feat: 添加omc执行脚本的systemd服务
This commit is contained in:
9
linux/lib/systemd/system/omc-exec.service
Normal file
9
linux/lib/systemd/system/omc-exec.service
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=omc execute script daemon
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
ExecStart=/usr/local/etc/omc/script/omc_exec.sh
|
||||||
|
Type=oneshot
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
1
linux/usr/local/etc/omc/script/omc_exec.sh
Normal file
1
linux/usr/local/etc/omc/script/omc_exec.sh
Normal file
@@ -0,0 +1 @@
|
|||||||
|
#!/bin/bash
|
||||||
@@ -5,8 +5,8 @@ RootDir=/usr/local/etc/omc
|
|||||||
# Perform post-installation configuration
|
# Perform post-installation configuration
|
||||||
echo ""
|
echo ""
|
||||||
echo "Output: $RootDir"
|
echo "Output: $RootDir"
|
||||||
echo "Please Run:"
|
echo "Service:"
|
||||||
echo " sudo systemctl start|stop|status|restart omc.service"
|
echo " sudo systemctl [start|stop|status|restart] omc.service"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# Check if this is the first installation or upgrade
|
# Check if this is the first installation or upgrade
|
||||||
@@ -55,7 +55,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
systemctl start omc.service
|
systemctl restart omc.service
|
||||||
systemctl start sshsvc.service
|
systemctl restart sshsvc.service
|
||||||
fi
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
|
|||||||
@@ -32,9 +32,9 @@ RootDir=/usr/local/etc/omc
|
|||||||
# Perform post-installation configuration
|
# Perform post-installation configuration
|
||||||
echo ""
|
echo ""
|
||||||
echo "Output: $RootDir"
|
echo "Output: $RootDir"
|
||||||
echo "Please Run:"
|
echo "Service:"
|
||||||
echo " sudo systemctl start|stop|status|restart omc.service"
|
echo " sudo systemctl [start|stop|status|restart] omc.service"
|
||||||
echo "Setting Firewall:"
|
echo "Firewall:"
|
||||||
echo " add: "
|
echo " add: "
|
||||||
echo " firewall-cmd --zone=public --add-port=80/tcp --permanent && firewall-cmd --reload"
|
echo " firewall-cmd --zone=public --add-port=80/tcp --permanent && firewall-cmd --reload"
|
||||||
echo " remove: "
|
echo " remove: "
|
||||||
@@ -87,8 +87,8 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
systemctl start omc.service
|
systemctl restart omc.service
|
||||||
systemctl start sshsvc.service
|
systemctl restart sshsvc.service
|
||||||
fi
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user