This commit is contained in:
Darren 2023-09-19 19:55:23 +08:00 committed by GitHub
parent d61d20e637
commit 975b670cdc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 37 additions and 59 deletions

View file

@ -5,10 +5,6 @@ PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
CheckEnvironment
InstallCockpit
function get_os_type() {
if [ -f /etc/os-release ]; then
. /etc/os-release
@ -128,14 +124,14 @@ if [ "$os_type" == 'Debian' ];then
fi
fi
# Todo: need replaced it with vars
# Check port used
if netstat -tuln | grep -qE ':(80|443|9000)\s'; then
echo "Port 80,443,9000 is already in use."
exit 1
else
echo "Port 80,443, 9000 are free."
fi
fi
}
@ -214,4 +210,7 @@ echo "Set cockpit port to 9000 ..."
sudo sed -i 's/ListenStream=9090/ListenStream=9000/' /lib/systemd/system/cockpit.socket
}
}
CheckEnvironment
InstallCockpit

View file

@ -2,8 +2,6 @@
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
InstallDocker
InstallDocker(){
@ -68,4 +66,6 @@ if ! docker network inspect websoft9 > /dev/null 2>&1; then
sudo docker network create websoft9
fi
}
}
InstallDocker

View file

@ -5,12 +5,15 @@ PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
# Define vars
install_path="/data/websoft9"
urls="https://w9artifact.blob.core.windows.net/release/websoft9"
# Define global vars
export http_port=80
export https_port=443
export cockpit_port=9000
export install_path="/data/websoft9"
export urls="https://w9artifact.blob.core.windows.net/release/websoft9"
if [[ "$1" == "dev" ]]; then
echo "update by dev artifact"
urls="https://w9artifact.blob.core.windows.net/dev/websoft9"
export urls="https://w9artifact.blob.core.windows.net/dev/websoft9"
fi
# Install runtime
@ -21,13 +24,13 @@ bash install_docker.sh
bash install_cockpit.sh
bash install_plugins.sh
# Install backend service
# Install backend services
cd $install_path/docker
sudo docker network create websoft9
sudo docker compose -p websoft9 up -d
# Install Systemd service
cd $install_path/systemd
cp $install_path/systemd/websoft9.service /lib/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable websoft9.service
sudo systemctl start websoft9

View file

@ -1,9 +1,8 @@
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
InstallPlugins
### -----------------------------------------------------###
@ -132,3 +131,5 @@ cp -r /data/apps/websoft9/cockpit/menu_override/* /etc/cockpit
echo "---------------------------------- Install success! When installation completed, you can access it by: http://Internet IP:9000 and using Linux user for login to install a app by websoft9's appstore. -------------------------------------------------------"
}
InstallPlugins

View file

@ -2,57 +2,32 @@
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
InstallTools
echo "Starting InstallTools..."
### -----------------------------------------------------###
InstallTools(){
echo "Prepare to install Tools ..."
if [ "$os_type" == 'CentOS' ] || [ "$os_type" == 'Rocky Linux' ] || [ "$os_type" == 'CentOS Stream' ] || [ "$os_type" == 'Fedora' ] || [ "$os_type" == 'OracleLinux' ] || [ "$os_type" == 'Redhat' ];then
sudo yum update -y
sudo yum install git curl wget yum-utils jq bc unzip -y
#!/bin/bash
fi
dnf --version >/dev/null 2>&1 || yum --version >/dev/null 2>&1 || apt --version >/dev/null 2>&1
if [ "$os_type" == 'Ubuntu' ] || [ "$os_type" == 'Debian' ] ;then
while fuser /var/lib/dpkg/lock >/dev/null 2>&1 ; do
if [ $? -eq 0 ]; then
dnf install git curl wget yum-utils jq bc unzip -y
elif [ $? -eq 0 ]; then
yum install git curl wget yum-utils jq bc unzip -y
elif [ $? -eq 0 ]; then
while fuser /var/lib/dpkg/lock >/dev/null 2>&1 ; do
echo "Waiting for other software managers to finish..."
sleep 5
done
sudo apt update -y 1>/dev/null 2>&1
if command -v git > /dev/null;then
echo "git installed ..."
else
sudo apt install git -y
fi
if command -v curl > /dev/null;then
echo "jcurlq installed ..."
else
sudo apt install curl -y
fi
if command -v wget > /dev/null;then
echo "wget installed ..."
else
sudo apt install wget -y
fi
if command -v jq > /dev/null;then
echo "jq installed ..."
else
sudo apt install jq -y
fi
if command -v bc > /dev/null;then
echo "bc installed ..."
else
sudo apt install bc -y
fi
if command -v unzip > /dev/null;then
echo "unzip installed ..."
else
sudo apt install unzip -y
fi
done
sudo apt update -y 1>/dev/null 2>&1
apt install curl wget yum-utils jq bc unzip -y --assume-yes
else
echo "None of the required package managers are installed."
fi
}
InstallTools