mirror of
https://github.com/Websoft9/websoft9.git
synced 2024-11-25 00:50:30 +00:00
fix install
This commit is contained in:
parent
54df4c144b
commit
d00031f92d
4 changed files with 50 additions and 34 deletions
|
@ -1,2 +1 @@
|
|||
1. Fix install error: Cockpit override files
|
||||
2. Fix install: Docker error then exit 1
|
||||
1. Fix install error: Cockpit port
|
||||
|
|
|
@ -33,7 +33,6 @@ export PATH
|
|||
|
||||
# 设置参数的默认值
|
||||
version="latest"
|
||||
port="9000"
|
||||
channel="release"
|
||||
path="/data/websoft9/source"
|
||||
|
||||
|
@ -62,6 +61,13 @@ while [[ $# -gt 0 ]]; do
|
|||
esac
|
||||
done
|
||||
|
||||
if [ -n "$port" ]; then
|
||||
export port
|
||||
else
|
||||
port=9000
|
||||
fi
|
||||
|
||||
|
||||
# 输出参数值
|
||||
echo -e "\n------ Welcome to install Websoft9, it will take 3-5 minutes ------"
|
||||
echo -e "\nYour installation parameters are as follows: "
|
||||
|
@ -78,7 +84,6 @@ cat /etc/os-release | head -n 3 2>/dev/null
|
|||
|
||||
export http_port=80
|
||||
export https_port=443
|
||||
export cockpit_port=$port
|
||||
export install_path=$path
|
||||
export channel
|
||||
export version
|
||||
|
@ -346,7 +351,7 @@ install_systemd() {
|
|||
|
||||
|
||||
#--------------- main-----------------------------------------
|
||||
check_ports $http_port $https_port $cockpit_port
|
||||
check_ports $http_port $https_port $port
|
||||
install_tools
|
||||
download_source
|
||||
|
||||
|
|
|
@ -23,22 +23,14 @@ export PATH
|
|||
#
|
||||
# $ sudo sh install_cockpit.sh --port 9001
|
||||
|
||||
|
||||
|
||||
############################################################
|
||||
# Below vars export from install.sh
|
||||
# $cockpit_port
|
||||
# $port
|
||||
# $install_path
|
||||
############################################################
|
||||
|
||||
echo -e "\n\n-------- Cockpit --------"
|
||||
echo "cockpit_port:$cockpit_port"
|
||||
echo "install_path:$install_path"
|
||||
|
||||
# Install Cockpit at this port
|
||||
# If Cockpit installed, maintain its origin port
|
||||
port="9000"
|
||||
|
||||
# 获取参数值
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case $1 in
|
||||
--port)
|
||||
|
@ -51,6 +43,43 @@ while [[ $# -gt 0 ]]; do
|
|||
esac
|
||||
done
|
||||
|
||||
# Port priority: --port > ListenStream= > 9000
|
||||
|
||||
cockpit_exist() {
|
||||
systemctl list-unit-files | grep -q "cockpit.service"
|
||||
return $?
|
||||
}
|
||||
|
||||
if cockpit_exist; then
|
||||
cockpit_now_port=$(grep -oP "(?<=^ListenStream=).*" "/lib/systemd/system/cockpit.socket")
|
||||
if [ -z "${cockpit_now_port// }" ]; then
|
||||
echo "cockpit port is null,set it to 9000"
|
||||
cockpit_now_port=9000
|
||||
else
|
||||
echo "$cockpit_now_port at cockpit.socket"
|
||||
fi
|
||||
|
||||
else
|
||||
cockpit_now_port=9000
|
||||
fi
|
||||
|
||||
if [ -n "$port" ]; then
|
||||
cockpit_port=$port
|
||||
else
|
||||
cockpit_port=$cockpit_now_port
|
||||
fi
|
||||
|
||||
|
||||
if [ -n "$install_path" ]; then
|
||||
echo "Have found install files"
|
||||
else
|
||||
install_path="/data/websoft9/source"
|
||||
fi
|
||||
|
||||
echo -e "\nYour installation parameters are as follows: "
|
||||
echo "cockpit_port:$cockpit_port"
|
||||
echo "install_path:$install_path"
|
||||
|
||||
|
||||
echo_prefix_cockpit=$'\n[Cockpit] - '
|
||||
# package cockpit depends_on [cockpit-bridge,cockpit-ws,cockpit-system], but update cockpit the depends don't update
|
||||
|
@ -73,23 +102,6 @@ Pin: release a=$VERSION_CODENAME-backports
|
|||
Pin-Priority: 1000
|
||||
"
|
||||
|
||||
cockpit_exist() {
|
||||
systemctl list-unit-files | grep -q "cockpit.service"
|
||||
return $?
|
||||
}
|
||||
|
||||
|
||||
if cockpit_exist && [ -n "${cockpit_port// }" ]; then
|
||||
cockpit_port=$(grep -oP "(?<=^ListenStream=).*" "/lib/systemd/system/cockpit.socket")
|
||||
echo "$cockpit_port at cockpit.socket"
|
||||
fi
|
||||
|
||||
if [ -z "${cockpit_port// }" ]; then
|
||||
cockpit_port=$port
|
||||
echo "Confirm the port: $cockpit_port"
|
||||
fi
|
||||
|
||||
|
||||
check_ports() {
|
||||
local ports=("$@")
|
||||
|
||||
|
@ -311,7 +323,7 @@ Install_Cockpit(){
|
|||
Test_Cockpit(){
|
||||
echo "$echo_prefix_cockpit Test Cockpit console accessibility"
|
||||
test_cmd="curl localhost:$cockpit_port"
|
||||
|
||||
echo test_cmd
|
||||
start_time=$(date +%s)
|
||||
timeout=30
|
||||
while true; do
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"version": "0.8.26-rc2",
|
||||
"version": "0.8.26-rc3",
|
||||
"plugins": {
|
||||
"portainer": "0.0.6",
|
||||
"nginx": "0.0.5",
|
||||
|
|
Loading…
Reference in a new issue