33set -eu
44
55SCRIPT=$( readlink -f " $0 " )
6- SCRIPTPATH=$( dirname $SCRIPT )
6+ SCRIPTPATH=$( dirname " $SCRIPT " )
77
88# Patreon release contains bundled sewer, use it here
99PATH=$SCRIPTPATH /bin:$PATH
@@ -13,52 +13,37 @@ echo "Consider supporting developer on patreon: https://patreon.com/0lach"
1313sleep 3
1414
1515STEAMVR=" ${STEAMVR:- $HOME / .local/ share/ Steam/ steamapps/ common/ SteamVR} "
16- if ! test -d $STEAMVR ; then
16+ if ! test -d " $STEAMVR " ; then
1717 echo " SteamVR not found at $STEAMVR (Set \$ STEAMVR manually?)"
1818 exit 1
1919fi
2020echo " SteamVR at $STEAMVR "
2121
2222LIGHTHOUSE_DRIVER=$STEAMVR /drivers/lighthouse/bin/linux64
2323
24- if ! test -f $LIGHTHOUSE_DRIVER /driver_lighthouse.so; then
24+ if ! test -f " $LIGHTHOUSE_DRIVER /driver_lighthouse.so" ; then
2525 echo " Lighthouse driver not found, broken installation?"
2626 exit 1
2727fi
2828
29- if ! test -f $LIGHTHOUSE_DRIVER /driver_lighthouse_real.so; then
29+ if ! test -f " $LIGHTHOUSE_DRIVER /driver_lighthouse_real.so" ; then
3030 echo " = Moving original driver"
31- cp $LIGHTHOUSE_DRIVER /driver_lighthouse.so $LIGHTHOUSE_DRIVER /driver_lighthouse_real.so
32- elif ! grep -s " https://patreon.com/0lach" $LIGHTHOUSE_DRIVER /driver_lighthouse.so; then
31+ cp " $LIGHTHOUSE_DRIVER /driver_lighthouse.so" " $LIGHTHOUSE_DRIVER /driver_lighthouse_real.so"
32+ elif ! grep -s " https://patreon.com/0lach" " $LIGHTHOUSE_DRIVER /driver_lighthouse.so" ; then
3333 echo " Found both original driver, and old original driver, seems like SteamVR was updated"
3434 echo " = Moving updated original driver"
35- cp $LIGHTHOUSE_DRIVER /driver_lighthouse.so $LIGHTHOUSE_DRIVER /driver_lighthouse_real.so
35+ cp " $LIGHTHOUSE_DRIVER /driver_lighthouse.so" " $LIGHTHOUSE_DRIVER /driver_lighthouse_real.so"
3636else
3737 echo " = Proxy driver is already installed, updating"
3838fi
3939
4040echo " = Patching real driver"
41- sewer -v --backup $LIGHTHOUSE_DRIVER /driver_lighthouse_real.so.bak $LIGHTHOUSE_DRIVER /driver_lighthouse_real.so patch-file --partial $SCRIPTPATH /driver_lighthouse_real.sew || true
41+ sewer -v --backup " $LIGHTHOUSE_DRIVER /driver_lighthouse_real.so.bak" " $LIGHTHOUSE_DRIVER /driver_lighthouse_real.so" patch-file --partial " $SCRIPTPATH /driver_lighthouse_real.sew" || true
4242
4343echo " = Overriding current driver"
44- rsync -a $SCRIPTPATH /driver_lighthouse.so $LIGHTHOUSE_DRIVER /driver_lighthouse.so
44+ rsync -a " $SCRIPTPATH /driver_lighthouse.so" " $LIGHTHOUSE_DRIVER /driver_lighthouse.so"
4545
4646echo " = Updating proxy server"
47- rsync -ar $SCRIPTPATH /lens-server/ $LIGHTHOUSE_DRIVER /lens-server
48-
49- echo " = Testing proxy server"
50- LENS_SERVER=$LIGHTHOUSE_DRIVER /lens-server/lens-server.exe
51- WINE=" ${WINE:- wine} "
52- if test $( $WINE $LENS_SERVER check > /dev/null 2> /dev/null || echo $? ) -eq 42; then
53- echo " Wine found at $WINE "
54- # Success
55- elif test $( wine64 $LENS_SERVER check > /dev/null 2> /dev/null || echo $? ) -eq 42; then
56- echo " Wine found at wine64"
57- # Success
58- else
59- echo " Failed to start lens server, check that you can start it yourself using $WINE $LENS_SERVER "
60- echo " If you have wine installed at custom path, you can set \$ WINE variable, but make sure Steam can see it"
61- exit 1
62- fi
47+ rsync -ar " $SCRIPTPATH /lens-server/" " $LIGHTHOUSE_DRIVER /lens-server"
6348
6449echo " Installation finished, try to start SteamVR"
0 commit comments