mirror of
https://github.com/Websoft9/websoft9.git
synced 2025-01-23 09:20:20 +08:00
fix install
This commit is contained in:
parent
54df4c144b
commit
d00031f92d
@ -1,2 +1 @@
|
|||||||
1. Fix install error: Cockpit override files
|
1. Fix install error: Cockpit port
|
||||||
2. Fix install: Docker error then exit 1
|
|
||||||
|
@ -33,7 +33,6 @@ export PATH
|
|||||||
|
|
||||||
# 设置参数的默认值
|
# 设置参数的默认值
|
||||||
version="latest"
|
version="latest"
|
||||||
port="9000"
|
|
||||||
channel="release"
|
channel="release"
|
||||||
path="/data/websoft9/source"
|
path="/data/websoft9/source"
|
||||||
|
|
||||||
@ -62,6 +61,13 @@ while [[ $# -gt 0 ]]; do
|
|||||||
esac
|
esac
|
||||||
done
|
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 "\n------ Welcome to install Websoft9, it will take 3-5 minutes ------"
|
||||||
echo -e "\nYour installation parameters are as follows: "
|
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 http_port=80
|
||||||
export https_port=443
|
export https_port=443
|
||||||
export cockpit_port=$port
|
|
||||||
export install_path=$path
|
export install_path=$path
|
||||||
export channel
|
export channel
|
||||||
export version
|
export version
|
||||||
@ -346,7 +351,7 @@ install_systemd() {
|
|||||||
|
|
||||||
|
|
||||||
#--------------- main-----------------------------------------
|
#--------------- main-----------------------------------------
|
||||||
check_ports $http_port $https_port $cockpit_port
|
check_ports $http_port $https_port $port
|
||||||
install_tools
|
install_tools
|
||||||
download_source
|
download_source
|
||||||
|
|
||||||
|
@ -23,22 +23,14 @@ export PATH
|
|||||||
#
|
#
|
||||||
# $ sudo sh install_cockpit.sh --port 9001
|
# $ sudo sh install_cockpit.sh --port 9001
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
############################################################
|
############################################################
|
||||||
# Below vars export from install.sh
|
# Below vars export from install.sh
|
||||||
# $cockpit_port
|
# $port
|
||||||
# $install_path
|
# $install_path
|
||||||
############################################################
|
############################################################
|
||||||
|
|
||||||
echo -e "\n\n-------- Cockpit --------"
|
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
|
while [[ $# -gt 0 ]]; do
|
||||||
case $1 in
|
case $1 in
|
||||||
--port)
|
--port)
|
||||||
@ -51,6 +43,43 @@ while [[ $# -gt 0 ]]; do
|
|||||||
esac
|
esac
|
||||||
done
|
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] - '
|
echo_prefix_cockpit=$'\n[Cockpit] - '
|
||||||
# package cockpit depends_on [cockpit-bridge,cockpit-ws,cockpit-system], but update cockpit the depends don't update
|
# 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
|
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() {
|
check_ports() {
|
||||||
local ports=("$@")
|
local ports=("$@")
|
||||||
|
|
||||||
@ -311,7 +323,7 @@ Install_Cockpit(){
|
|||||||
Test_Cockpit(){
|
Test_Cockpit(){
|
||||||
echo "$echo_prefix_cockpit Test Cockpit console accessibility"
|
echo "$echo_prefix_cockpit Test Cockpit console accessibility"
|
||||||
test_cmd="curl localhost:$cockpit_port"
|
test_cmd="curl localhost:$cockpit_port"
|
||||||
|
echo test_cmd
|
||||||
start_time=$(date +%s)
|
start_time=$(date +%s)
|
||||||
timeout=30
|
timeout=30
|
||||||
while true; do
|
while true; do
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"version": "0.8.26-rc2",
|
"version": "0.8.26-rc3",
|
||||||
"plugins": {
|
"plugins": {
|
||||||
"portainer": "0.0.6",
|
"portainer": "0.0.6",
|
||||||
"nginx": "0.0.5",
|
"nginx": "0.0.5",
|
||||||
|
Loading…
Reference in New Issue
Block a user