mirror of
https://github.com/Websoft9/websoft9.git
synced 2025-02-02 17:08:38 +08:00
rc
This commit is contained in:
parent
996fb99dc2
commit
d3a27e5579
@ -21,11 +21,8 @@ FILES="$cockpit_service_path $config_path"
|
|||||||
# 监控文件发生变动时需要做的事情
|
# 监控文件发生变动时需要做的事情
|
||||||
on_change() {
|
on_change() {
|
||||||
set +e
|
set +e
|
||||||
# 从配置文件中获取端口号
|
|
||||||
|
|
||||||
cockpit_port=$(docker exec -i websoft9-apphub apphub getconfig --section cockpit --key port)
|
cockpit_port=$(docker exec -i websoft9-apphub apphub getconfig --section cockpit --key port)
|
||||||
listen_stream=$(grep -Po 'ListenStream=\K[0-9]*' /lib/systemd/system/cockpit.socket)
|
listen_stream=$(grep -Po 'ListenStream=\K[0-9]*' /lib/systemd/system/cockpit.socket)
|
||||||
|
|
||||||
if [ "$cockpit_port" != "$listen_stream" ]; then
|
if [ "$cockpit_port" != "$listen_stream" ]; then
|
||||||
sed -i "s/ListenStream=${listen_stream}/ListenStream=${cockpit_port}/" /lib/systemd/system/cockpit.socket
|
sed -i "s/ListenStream=${listen_stream}/ListenStream=${cockpit_port}/" /lib/systemd/system/cockpit.socket
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
@ -33,7 +30,6 @@ on_change() {
|
|||||||
systemctl restart cockpit || exit 1
|
systemctl restart cockpit || exit 1
|
||||||
set_Firewalld
|
set_Firewalld
|
||||||
fi
|
fi
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user