Last active
February 4, 2023 01:18
-
-
Save rajiteh/d51b864fc5f9fa9aa1420e9a044cee3b to your computer and use it in GitHub Desktop.
wine hlds launcher
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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