forked from ChristophHaag/SteamVR-OpenHMD
-
Notifications
You must be signed in to change notification settings - Fork 0
/
register.sh
executable file
·48 lines (38 loc) · 1.03 KB
/
register.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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
DIR=$(dirname "$(readlink -f "$0")")
source "$DIR"/paths.sh
if [ -z "$STEAMDIR" ];
then
echo "Error! Did not find Steam path"
exit 1
else
echo "Found Steam in $STEAMDIR"
fi
if [ -z "$STEAMVRDIR" ];
then
echo "Error! Did not find SteamVR path"
exit 1
else
echo "Found SteamVR in $STEAMVRDIR"
fi
mkdir -p "$BACKUPDIR"
if [ ! -d "$DIR"/build ]; then
echo "Please build in $DIR/build for this script to work"
exit 1
fi
if [ ! -f "$VRPATHREG" ]; then
echo "Please install SteamVR such that $VRPATHREG exists"
exit 1
fi
if [ -f "$CURRENTCONFIG" ]; then
echo "Found config in $CURRENTCONFIG"
echo "Backing up current config to $BACKUPDIR..."
mv "$CURRENTCONFIG" "$BACKUPDIR"
echo "Backed up config!"
fi
echo "Installing SteamVR-OpenHMD config..."
cp "$OHMDCONFIG" "$CURRENTCONFIG"
echo "Installed SteamVR-OpenHMD config"
echo "Registering SteamVR-OpenHMD plugin with SteamVR..."
LD_LIBRARY_PATH="$OPENVR_API_PATH:$LD_LIBRARY_PATH" "$VRPATHREG" adddriver "$DIR"/build
echo "Registered SteamVR-OpenHMD plugin with SteamVR!"