#!/usr/bin/zsh url=`curl -I -L "https://discord.com/api/download?platform=linux&format=deb" 2>&1 | grep -i location | grep -oE "https.*deb"` if [ ! -e "/tmp/discord.deb" ]; then wget -O /tmp/discord.deb $url fi dpkg -iE /tmp/discord.deb