From 6db2e3ca447f5575a3e8184a788b6adc9743f20e Mon Sep 17 00:00:00 2001 From: Darren <27513732@qq.com> Date: Sun, 8 Oct 2023 11:27:06 +0800 Subject: [PATCH] fix --- README.md | 8 +++++--- install/install.sh | 27 +++++++++++++++++---------- install/install_cockpit.sh | 3 ++- 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 94946780..d343f7d1 100644 --- a/README.md +++ b/README.md @@ -34,9 +34,11 @@ You can see the sceenshoots below: - Manage your Linux by GUI: Inspect and change network settings, Configure a firewall, Manage storage, Browse and search system logs, Inspect a system’s hardware, Inspect and interact with systemd-based services, - Supported languages: English, Chinese(中文) -# Install & Upgrade +# Installation -You should have root privileges user to install or upgrade Websoft9, if you use no-root user you can `sudo su` for it +You should have root privileges user to install or upgrade or uninstall Websoft9, if you use no-root user you can `sudo su` for it + +## Install & Upgrade ``` # Install by default @@ -48,7 +50,7 @@ wget -O - https://websoft9.github.io/websoft9/install/install.sh | bash /dev/std ``` After installation, access it by: **http://Internet IP:9000** and using **Linux user** for login -# Uninstall +## Uninstall ``` # Uninstall by default diff --git a/install/install.sh b/install/install.sh index 80c1ba42..814228a3 100644 --- a/install/install.sh +++ b/install/install.sh @@ -63,12 +63,16 @@ while [[ $# -gt 0 ]]; do done # 输出参数值 -echo "Your installation parameters are as follows: " +echo -e "\n------ Welcome to install Websoft9, it will take 3-5 minutes ------" +echo -e "\nYour installation parameters are as follows: " echo "--version: $version" echo "--port: $port" echo "--channel: $channel" echo "--path: $path" +echo -e "\nYour OS: " +cat /etc/os-release | head -n 3 2>/dev/null + # Define global vars # export var can send it to subprocess @@ -107,8 +111,6 @@ Wait_apt() { export -f Wait_apt - - install_tools(){ echo_prefix_tools=$'\n[Tools] - ' echo "$echo_prefix_tools Starting install necessary tool..." @@ -252,11 +254,16 @@ EOF set_docker(){ echo "Set Docker for Websoft9 backend service..." merge_json_files - if ! docker network inspect websoft9 > /dev/null 2>&1; then - sudo systemctl stop firewalld 2> /dev/null - sudo docker network create websoft9 - sudo systemctl restart docker + if ! systemctl is-active --quiet firewalld; then + echo "firewalld is not running" + else + echo "Set firewall for Docker..." + sudo sudo firewall-cmd --permanent --new-zone=docker 2> /dev/null + sudo firewall-cmd --permanent --zone=docker --add-interface=docker0 2> /dev/null + sudo firewall-cmd --permanent --zone=docker --set-target=ACCEPT + sudo firewall-cmd --reload fi + sudo systemctl restart docker } install_backends() { @@ -339,8 +346,6 @@ install_systemd() { #--------------- main----------------------------------------- - -echo "------ Welcome to install Websoft9, it will take 3-5 minutes ------" check_ports $http_port $https_port $cockpit_port install_tools download_source @@ -365,4 +370,6 @@ fi install_backends install_systemd -echo "-- Install success! Access Websoft9 console by: http://Internet IP:$cockpit_port and using Linux user for login ------" \ No newline at end of file + +echo -e "\n-- Install success! ------" +echo "Access Websoft9 console by: http://Internet IP:$(grep ListenStream /lib/systemd/system/cockpit.socket | cut -d= -f2) and using Linux user for login" \ No newline at end of file diff --git a/install/install_cockpit.sh b/install/install_cockpit.sh index 458204a2..d7131971 100644 --- a/install/install_cockpit.sh +++ b/install/install_cockpit.sh @@ -81,11 +81,12 @@ cockpit_exist() { 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 "Maintain original port: $cockpit_port" + echo "Confirm the port: $cockpit_port" fi