2 Star 9 Fork 5

chuanjiao10 / kasini3000_agent_linux

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
alpine_del_dropbear_install_opensshserver.ash 866 Bytes
一键复制 编辑 原始数据 按行查看 历史
chuanjiao10 提交于 2020-03-08 18:04 . 新增支持alpine linux
if grep -iEq 'alpine' /etc/issue || grep -iEq 'alpine' /etc/*-release
then
echo 'linux is alpine'
echo 'Warning: dropbear sshd will be disabled.'
OPENSSH_INSTALLED=`apk info |grep -i "openssh-server$"`
if [ ${OPENSSH_INSTALLED} == "openssh-server" ]
then
echo 'openssh-server 已经安装!'
else
echo '开始安装 openssh-server'
apk update
apk add openssh-server
echo 'openssh-server 安装完成!'
fi
OPENSSH_STATUS=`rc-status |grep "sshd.*started"`
if [ -z "${OPENSSH_STATUS}" ]
then
echo '正在停止 dropbear服务!'
rc-service dropbear stop
sleep 1
rc-update del dropbear
echo '正在启动 openssh-server服务!'
rc-update add sshd
rc-service sshd start
exit 0
else
echo 'openssh-server 已经启动!'
exit 0
fi
else
echo 'linux not alpine'
exit 3
fi
Shell
1
https://gitee.com/chuanjiao10/kasini3000_agent_linux.git
git@gitee.com:chuanjiao10/kasini3000_agent_linux.git
chuanjiao10
kasini3000_agent_linux
kasini3000_agent_linux
master

搜索帮助