2022-11-12 03:15:44 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# Elevate script
|
|
|
|
if [ ! "$UID" -eq 0 ]
|
|
|
|
then
|
2023-01-23 14:55:10 +00:00
|
|
|
sudo bash "$BASH_SOURCE";
|
2022-11-13 00:11:32 +00:00
|
|
|
else
|
2023-01-23 14:55:10 +00:00
|
|
|
apt install -y wget gpg;
|
2023-01-23 15:11:51 +00:00
|
|
|
keyFile="$(mktemp)";
|
2022-11-12 03:15:44 +00:00
|
|
|
|
2022-11-13 00:11:32 +00:00
|
|
|
wget -qO- https://packages.microsoft.com/keys/microsoft.asc \
|
2023-01-23 15:11:51 +00:00
|
|
|
| gpg --dearmor > "$keyFile";
|
2022-11-12 03:15:44 +00:00
|
|
|
|
2023-01-23 15:11:51 +00:00
|
|
|
install -D -o root -g root -m 644 "$keyFile" /etc/apt/keyrings/packages.microsoft.gpg;
|
2022-11-12 03:15:44 +00:00
|
|
|
|
2022-11-13 00:11:32 +00:00
|
|
|
echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" \
|
2023-01-23 14:55:10 +00:00
|
|
|
| tee /etc/apt/sources.list.d/vscode.list;
|
2022-11-12 03:15:44 +00:00
|
|
|
|
2023-01-23 15:11:51 +00:00
|
|
|
rm -f "$keyFile";
|
2022-11-13 00:12:31 +00:00
|
|
|
|
2023-01-23 14:55:10 +00:00
|
|
|
apt update;
|
|
|
|
apt install -y code;
|
2022-11-13 00:11:32 +00:00
|
|
|
fi
|