Quantcast
View Feature Request
DownloadNewData Steam Proton Support
Feature #: 1746
File: HarvestMap
Date: 06/13/19 01:06 AM
By: MasterCasper
Status: Under Review
Hey, I run ESO using Steam Proton and changed the DownloadNewData script to support it. Please see below:

DownloadNewData.sh

Code:
#!/bin/bash
# (C) 2018 @mojo66, [email protected]

# enjoy the beauty of scripting on a professional operating system

# exit if ESO is running
pgrep -x eso64.exe
if [[ ! $? -eq 1 ]]; then echo "Quit ESO before running this script to avoid data corruption.";exit 1;fi

# use absolute paths. this makes the script work regardless of the dir it resides in

addondir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
basedir=${addondir}/../../
emptyfile=${addondir}/Main/emptyTable.lua

# check if everything exists
if [[ ! -e "${addondir}" ]]; then echo "ERROR: ${addondir} does not exists, re-install this AddOn and try again...";exit 1;fi

savedvardir=${basedir}/SavedVariables
if [[ ! -e "${savedvardir}" ]]; then 
	# create saved vars dir if it doesn't exist
	echo "${savedvardir} doesn't exist. Creating..."
	mkdir "${savedvardir}"
	if [[ $? -gt 0 ]]; then echo "ERROR: Failed to create ${savedvardir}."; exit 1;fi
fi

# iterate over the different zones

for zone in AD EP DC DLC NF; do 

	fn=HarvestMap${zone}.lua

	echo "Working on ${fn}..."

	svfn1=${savedvardir}/${fn}
	svfn2=${svfn1}~

	# if saved var file exists, create backup...
	if [[ -e ${svfn1} ]]; then

		cp -fp "${svfn1}" "${svfn2}"

	# ...else, use empty table to create a placeholder
	else 
		name=Harvest${i}_SavedVars
		echo -n ${name} | cat - "${emptyfile}" > "${svfn2}"

	fi

	# up/download. Note that the equivalent of the next line requires 89 lines of code on Windows 

	curl -# -d @"${svfn2}" -o "${svfn1}" "http://harvestmap.binaryvector.net:8080"

	rm "${svfn2}"
done

RSS 2.0 Feed for Favorite CommentsNotes Sort Options
By: MasterCasper - 06/13/19 01:13 AM
Sorry, this isn't working. I'll update when I've fixed it.
By: MasterCasper - 06/13/19 01:34 AM
Fixed:
Code:
#!/bin/bash
# (C) 2018 @mojo66, [email protected]

# enjoy the beauty of scripting on a professional operating system

# exit if ESO is running
pgrep -x eso64.exe
if [[ ! $? -eq 1 ]]; then echo "Quit ESO before running this script to avoid data corruption.";exit 1;fi

# use absolute paths. this makes the script work regardless of the dir it resides in

addondir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
basedir=${addondir}/../..
emptyfile=${addondir}/Main/emptyTable.lua

# check if everything exists
if [[ ! -e "${addondir}" ]]; then echo "ERROR: ${addondir} does not exists, re-install this AddOn and try again...";exit 1;fi

savedvardir=${basedir}/SavedVariables
if [[ ! -e "${savedvardir}" ]]; then 
	# create saved vars dir if it doesn't exist
	echo "${savedvardir} doesn't exist. Creating..."
	mkdir "${savedvardir}"
	if [[ $? -gt 0 ]]; then echo "ERROR: Failed to create ${savedvardir}."; exit 1;fi
fi

# iterate over the different zones

for zone in AD EP DC DLC NF; do 

	fn=HarvestMap${zone}.lua

	echo "Working on ${fn}..."

	svfn1=${savedvardir}/${fn}
	svfn2=${svfn1}~

	# if saved var file exists, create backup...
	if [[ -e ${svfn1} ]]; then

		cp -fp "${svfn1}" "${svfn2}"

	# ...else, use empty table to create a placeholder
	else 
		name=Harvest${zone}_SavedVars
		echo -n ${name} | cat - "${emptyfile}" > "${svfn2}"
	fi

	# up/download. Note that the equivalent of the next line requires 89 lines of code on Windows 

	curl -# -d @"${svfn2}" -o "${svfn1}" "http://harvestmap.binaryvector.net:8080"

	rm "${svfn2}"
done