66# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
77
88function header_info {
9- cat << "EOF "
9+ cat << "EOF "
1010 ______ __ _____
1111 / ____/___ ____/ /__ / ___/___ ______ _____ _____
1212 / / / __ \/ __ / _ \ \__ \/ _ \/ ___/ | / / _ \/ ___/
@@ -26,7 +26,7 @@ CL=$(echo "\033[m")
2626BFR=" \\ r\\ 033[K"
2727HOLD=" -"
2828CM=" ${GN} ✓${CL} "
29- APP=" Code Server"
29+ APP=" Coder Code Server"
3030hostname=" $( hostname) "
3131set -o errexit
3232set -o errtrace
@@ -37,40 +37,40 @@ alias die='EXIT=$? LINE=$LINENO error_exit'
3737trap die ERR
3838
3939function error_exit() {
40- trap - ERR
41- local reason=" Unknown failure occured."
42- local msg=" ${1:- $reason } "
43- local flag=" ${RD} ‼ ERROR ${CL} $EXIT @$LINE "
44- echo -e " $flag $msg " 1>&2
45- exit $EXIT
40+ trap - ERR
41+ local reason=" Unknown failure occured."
42+ local msg=" ${1:- $reason } "
43+ local flag=" ${RD} ‼ ERROR ${CL} $EXIT @$LINE "
44+ echo -e " $flag $msg " 1>&2
45+ exit " $EXIT "
4646}
4747clear
4848header_info
4949if command -v pveversion > /dev/null 2>&1 ; then
50- echo -e " ⚠️ Can't Install on Proxmox "
51- exit
50+ echo -e " ⚠️ Can't Install on Proxmox "
51+ exit
5252fi
5353if [ -e /etc/alpine-release ]; then
54- echo -e " ⚠️ Can't Install on Alpine"
55- exit
54+ echo -e " ⚠️ Can't Install on Alpine"
55+ exit
5656fi
5757while true ; do
58- read -p " This will Install ${APP} on $hostname . Proceed(y/n)?" yn
59- case $yn in
60- [Yy]* ) break ;;
61- [Nn]* ) exit ;;
62- * ) echo " Please answer yes or no." ;;
63- esac
58+ read -p " This will Install ${APP} on $hostname . Proceed(y/n)?" yn
59+ case $yn in
60+ [Yy]* ) break ;;
61+ [Nn]* ) exit ;;
62+ * ) echo " Please answer yes or no." ;;
63+ esac
6464done
6565
6666function msg_info() {
67- local msg=" $1 "
68- echo -ne " ${HOLD} ${YW}${msg} ..."
67+ local msg=" $1 "
68+ echo -ne " ${HOLD} ${YW}${msg} ..."
6969}
7070
7171function msg_ok() {
72- local msg=" $1 "
73- echo -e " ${BFR} ${CM} ${GN}${msg}${CL} "
72+ local msg=" $1 "
73+ echo -e " ${BFR} ${CM} ${GN}${msg}${CL} "
7474}
7575
7676msg_info " Installing Dependencies"
@@ -80,22 +80,22 @@ apt-get install -y git &>/dev/null
8080msg_ok " Installed Dependencies"
8181
8282VERSION=$( curl -fsSL https://api.github.com/repos/coder/code-server/releases/latest |
83- grep " tag_name" |
84- awk ' {print substr($2, 3, length($2)-4) }' )
83+ grep " tag_name" |
84+ awk ' {print substr($2, 3, length($2)-4) }' )
8585
8686msg_info " Installing Code-Server v${VERSION} "
87- curl -fOL https://github.com/coder/code-server/releases/download/v$VERSION /code-server_${VERSION} _amd64.deb & > /dev/null
88- dpkg -i code-server_${VERSION} _amd64.deb & > /dev/null
89- rm -rf code-server_${VERSION} _amd64.deb
87+ curl -fOL https://github.com/coder/code-server/releases/download/v" $VERSION " /code-server_" ${VERSION} " _amd64.deb & > /dev/null
88+ dpkg -i code-server_" ${VERSION} " _amd64.deb & > /dev/null
89+ rm -rf code-server_" ${VERSION} " _amd64.deb
9090mkdir -p ~ /.config/code-server/
91- systemctl enable -q --now code-server@$USER
91+ systemctl enable -q --now code-server@" $USER "
9292cat << EOF >~/.config/code-server/config.yaml
9393bind-addr: 0.0.0.0:8680
9494auth: none
9595password:
9696cert: false
9797EOF
98- systemctl restart code-server@$USER
98+ systemctl restart code-server@" $USER "
9999msg_ok " Installed Code-Server v${VERSION} on $hostname "
100100
101101echo -e " ${APP} should be reachable by going to the following URL.
0 commit comments