JumpServer 一键安装命令如下:
curl -sSL https://resource.fit2cloud.com/jumpserver/jumpserver/releases/latest/download/quick_start.sh | bash
上述quick_start.sh脚本详细内容如下:
#!/usr/bin/env bash
#VERSION=v3.10.1
DOWNLOAD_URL=https://resource.fit2cloud.comfunction install_soft() {if command -v dnf > /dev/null; thendnf -q -y install "$1"elif command -v yum > /dev/null; thenyum -q -y install "$1"elif command -v apt > /dev/null; thenapt-get -qqy install "$1"elif command -v zypper > /dev/null; thenzypper -q -n install "$1"elif command -v apk > /dev/null; thenapk add -q "$1"command -v gettext >/dev/null || {apk add -q gettext-dev python3}elseecho -e "[\033[31m ERROR \033[0m] $1 command not found, Please install it first"exit 1fi
}function prepare_install() {for i in curl wget tar iptables; docommand -v $i &>/dev/null || install_soft $idone
}function get_installer() {echo "download install script to /opt/jumpserver-installer-${VERSION}"cd /opt || exit 1if [ ! -d "/opt/jumpserver-installer-${VERSION}" ]; thentimeout 60 wget -qO jumpserver-installer-${VERSION}.tar.gz ${DOWNLOAD_URL}/jumpserver/installer/releases/download/${VERSION}/jumpserver-installer-${VERSION}.tar.gz || {rm -f /opt/jumpserver-installer-${VERSION}.tar.gzecho -e "[\033[31m ERROR \033[0m] Failed to download jumpserver-installer-${VERSION}"exit 1}tar -xf /opt/jumpserver-installer-${VERSION}.tar.gz -C /opt || {rm -rf /opt/jumpserver-installer-${VERSION}echo -e "[\033[31m ERROR \033[0m] Failed to unzip jumpserver-installer-${VERSION}"exit 1}rm -f /opt/jumpserver-installer-${VERSION}.tar.gzfi
}function config_installer() {cd /opt/jumpserver-installer-${VERSION} || exit 1sed -i "s/VERSION=.*/VERSION=${VERSION}/g" /opt/jumpserver-installer-${VERSION}/static.envsed -i "s/# DOCKER_IMAGE_MIRROR=1/DOCKER_IMAGE_MIRROR=1/g" /opt/jumpserver-installer-${VERSION}/config-example.txt./jmsctl.sh install./jmsctl.sh start
}function main(){if [[ "${OS}" == 'Darwin' ]]; thenechoecho "Unsupported Operating System Error"exit 1fiprepare_installget_installerconfig_installer
}main