-
Notifications
You must be signed in to change notification settings - Fork 8
/
startrenderer.sh
24 lines (22 loc) · 1.1 KB
/
startrenderer.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
#Check for updates
echo "Checking for client updates..."
latestVersion=$(curl --silent --head https://www.sheepit-renderfarm.com/media/applet/client-latest.php | \
grep -Po '(?i)content-disposition:.*filename="?(?-i)\Ksheepit-client-[\d\.]+\d')
if [ -z "$latestVersion" ]; then
#Empty latestVersion probably means a server or network issue that would prevent rendering
echo "Unable to get latest version info; this is likely a network or server issue. Try checking the site and pulling updates, then submit a GitHub issue if that doesn't fix it"
exit 1
elif [ ! -e $latestVersion.jar ]; then
echo "Updating client to version $latestVersion..."
rm -f sheepit-client*.jar
#Download new client.
curl https://www.sheepit-renderfarm.com/media/applet/client-latest.php -o $latestVersion.jar
fi
#Autodetect cores
if [ $cpu -eq 0 ]; then
echo "No core count specified, autodetected `nproc` cores."
cpu=$(nproc)
fi
echo Starting client.
java -jar /sheep/$latestVersion.jar -ui text -login "$user_name" -password "$user_password" -cores "$cpu" -cache-dir /sheep/cache $extra_arg