#!/usr/bin/env bash

function main() {
    local url="http://files.lyleserver.com/scripts/install_ubuntu_guest_additions.bash"
    local script="/tmp/install_ubuntu_guest_additions.bash"

    if ! wget -q -O "${script}" "${url}"
    then
        printf "\nCould not download file from \"%s\"\n" "${url}"
    fi

    if sudo bash "${script}"
    then
        rm -- "$0"
    fi

}

main "$@"
