File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -3,15 +3,20 @@ if [[ $EUID -ne 0 ]]; then
3
3
echo " This script must be run as root" 1>&2
4
4
exit 1
5
5
fi
6
+ function t-d-uninstaller {
7
+ rm -rf $tmp_dir
8
+ echo " Temporary directory uninstalled"
9
+ exit 1
10
+ }
6
11
tmp_dir=$( mktemp -d -t pub_key-XXXXXX)
12
+ trap t-d-uninstaller SIGINT SIGTERM
7
13
echo $tmp_dir
8
14
echo ' deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main' > /etc/apt/sources.list.d/google-chrome.list
9
15
echo " deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list
10
16
curl -fsSL https://dl.google.com/linux/linux_signing_key.pub | apt-key add linux_signing_key.pub
11
17
curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > $tmp_dir /microsoft.gpg
12
- install -o root -g root -m 644 microsoft.gpg /etc/apt/trusted.gpg.d/
18
+ install -o root -g root -m 644 $tmp_dir / microsoft.gpg /etc/apt/trusted.gpg.d/
13
19
apt update
14
20
echo ' Start install'
15
21
apt-get -y install google-chrome-stable git apt-transport-https code
16
- rm -rf $tmp_dir
17
- echo ' Complete'
22
+ t-d-uninstaller
You can’t perform that action at this time.
0 commit comments