Skip to content

Instantly share code, notes, and snippets.

@StefanoBelli
Created March 12, 2020 08:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save StefanoBelli/377b4a2a11aa3df617a8d07aa560f14d to your computer and use it in GitHub Desktop.
Save StefanoBelli/377b4a2a11aa3df617a8d07aa560f14d to your computer and use it in GitHub Desktop.
#!/bin/bash
DL="https://teams.microsoft.com/downloads/desktopurl?env=production&plat=linux&arch=x64&download=true&linuxArchiveType=deb"
BUILDDIR=/tmp/teams-build
PRIV="sudo"
if ! which wget 2>/dev/null >>/dev/null; then
echo "unable to find wget"
exit 1
fi
if ! which tar 2>/dev/null >>/dev/null; then
echo "unable to find tar"
exit 1
fi
if ! which ar 2>/dev/null >>/dev/null; then
echo "unable to find ar"
exit 1
fi
if ! which $PRIV 2>/dev/null >>/dev/null; then
echo "using su to privilege escalate"
PRIV="su -c"
else
echo "using sudo as privilege escalation method, you will (probably) be asked for password"
fi
echo "creating build directory ($BUILDDIR)"
mkdir -p $BUILDDIR
cd $BUILDDIR
echo "downloading teams..."
wget $DL -O teams.deb 2>/dev/null >>/dev/null || exit 2
echo "extracting archives..."
ar x teams.deb >>/dev/null || exit 3
tar xfv data.tar.xz >>/dev/null || exit 4
echo "installing teams..."
$PRIV cp ./usr/bin/* /usr/bin || exit 5
$PRIV cp ./usr/share/applications/* /usr/share/applications || exit 6
$PRIV cp ./usr/share/pixmaps/* /usr/share/pixmaps || exit 7
$PRIV cp -r ./usr/share/teams /usr/share || exit 8
echo "cleanup..."
cd
rm -r $BUILDDIR
echo "done."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment