6
6
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
7
7
8
8
function header_info {
9
- cat << "EOF "
9
+ cat << "EOF "
10
10
______ __ _____
11
11
/ ____/___ ____/ /__ / ___/___ ______ _____ _____
12
12
/ / / __ \/ __ / _ \ \__ \/ _ \/ ___/ | / / _ \/ ___/
@@ -26,7 +26,7 @@ CL=$(echo "\033[m")
26
26
BFR=" \\ r\\ 033[K"
27
27
HOLD=" -"
28
28
CM=" ${GN} ✓${CL} "
29
- APP=" Code Server"
29
+ APP=" Coder Code Server"
30
30
hostname=" $( hostname) "
31
31
set -o errexit
32
32
set -o errtrace
@@ -37,40 +37,40 @@ alias die='EXIT=$? LINE=$LINENO error_exit'
37
37
trap die ERR
38
38
39
39
function 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 "
46
46
}
47
47
clear
48
48
header_info
49
49
if 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
52
52
fi
53
53
if [ -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
56
56
fi
57
57
while 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
64
64
done
65
65
66
66
function msg_info() {
67
- local msg=" $1 "
68
- echo -ne " ${HOLD} ${YW}${msg} ..."
67
+ local msg=" $1 "
68
+ echo -ne " ${HOLD} ${YW}${msg} ..."
69
69
}
70
70
71
71
function 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} "
74
74
}
75
75
76
76
msg_info " Installing Dependencies"
@@ -80,22 +80,22 @@ apt-get install -y git &>/dev/null
80
80
msg_ok " Installed Dependencies"
81
81
82
82
VERSION=$( 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) }' )
85
85
86
86
msg_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
90
90
mkdir -p ~ /.config/code-server/
91
- systemctl enable -q --now code-server@$USER
91
+ systemctl enable -q --now code-server@" $USER "
92
92
cat << EOF >~/.config/code-server/config.yaml
93
93
bind-addr: 0.0.0.0:8680
94
94
auth: none
95
95
password:
96
96
cert: false
97
97
EOF
98
- systemctl restart code-server@$USER
98
+ systemctl restart code-server@" $USER "
99
99
msg_ok " Installed Code-Server v${VERSION} on $hostname "
100
100
101
101
echo -e " ${APP} should be reachable by going to the following URL.
0 commit comments