Skip to content

Instantly share code, notes, and snippets.

@rajiteh
Last active February 4, 2023 01:18
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 rajiteh/d51b864fc5f9fa9aa1420e9a044cee3b to your computer and use it in GitHub Desktop.
Save rajiteh/d51b864fc5f9fa9aa1420e9a044cee3b to your computer and use it in GitHub Desktop.
wine hlds launcher
#!/bin/bash
set -euo pipefail
download_location="/home/wineuser/.wine/drive_c"
hlds_bin="${download_location}/Counter-Strike/hlds.exe"
function log() {
printf >&2 "%s:\t%s\n" "$(date)" "${@}"
}
if [[ -f "${hlds_bin}" ]]; then
log "HLDS discovered at ${hlds_bin}"
else
log "HLDS not found, downloading ... "
mkdir -p "${download_location}"
dl_path="$(mktemp --suffix=.zip)"
wget -O "${dl_path}" ${DOWNLOAD_URL}
unzip "${dl_path}" -d "${download_location}"
fi
log "Launching ..."
exec wine cmd.exe /C "cd /D C:\Counter-Strike\ && hlds.exe -game cstrike -console +map aim_map"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment