#!/bin/sh # fetches all of our download sources (and verifies them) set -e fetch_resource() { BASENAME=$(basename "$1") SHA512FILE=$(cat "./sums/$BASENAME.sha512") if [ ! -f "$BASENAME" ] then printf "Grabbing $2..." wget -nc "$1" printf "\n" fi SHA512SUM=$(sha512sum "$BASENAME") if [ "$SHA512SUM" = "$SHA512FILE" ] then printf "$BASENAME has been verified.\n" else printf "$BASENAME has the invalid sha512sum. Error!\n" exit fi } fetch_resource "http://archive.org/download/Half-lifeUplink/hluplink.exe" "Half-Life: Uplink" fetch_resource "http://archive.org/download/half-life-patches/English/Update 1.1.1.0 English/hl1110.exe" "Half-Life: Patch 1.1.1.0" fetch_resource "https://archive.org/download/opfor-demo/opfordemofull.exe" "Half-Life: Opposing Force - Demo" fetch_resource "https://downloads.ammahls.com/HLSDK/hl_sdk_v23.exe" "Half-Life SDK v2.3" # if we pass a Steam path, skip this one if [ -z "$HL_STEAM_INSTALL" ] then fetch_resource "http://archive.org/download/steaminstall_halflife/steaminstall_halflife.exe" "Steam Installer with Half-Life Cache" fi