提交 3838c1b4 编写于 作者: 搞机玩家's avatar 搞机玩家

optimize

上级 8393b1fd
#!/bin/bash
# 参考:https://coder.com/docs/code-server/install
# curl -sSf https://gitcode.net/cloudswave/code-server/-/raw/master/ubuntu-debian/install.sh | bash
CONFIG_FILE=~/.config/code-server/config.yaml
echo -n "输入code-server版本(默认4.90.3): "
read VERSION
echo -n "输入code-server端口(默认8080): "
read port
echo -n "输入code-server密码(默认123456): "
read password
VERSION=${VERSION:-4.90.3}
port=${port:-8080}
password=${password:-123456}
# 添加默认配置到config.yaml
if [[ ! -e $CONFIG_FILE ]]; then
echo 配置文件${CONFIG_FILE}不存在,正在创建...
touch $CONFIG_FILE
fi
# 清空文件
> $CONFIG_FILE
# 追加默认配置
echo bind-addr: 0.0.0.0:${port} >> $CONFIG_FILE
echo 'auth: password' >> $CONFIG_FILE
echo password: ${password} >> $CONFIG_FILE
echo 'cert: false' >> $CONFIG_FILE
cat $CONFIG_FILE
echo 准备安装code-server:${VERSION}
curl -fOL https://x.haod.me/https://github.com/coder/code-server/releases/download/v$VERSION/code-server_${VERSION}_amd64.deb
......@@ -15,4 +40,4 @@ sleep 5
screen -ls
echo "服务器配置信息:"
cat ~/.config/code-server/config.yaml
cat $CONFIG_FILE
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册