Skip to content

Instantly share code, notes, and snippets.

@Furzel
Created February 27, 2014 10:10
Show Gist options
  • Save Furzel/9247495 to your computer and use it in GitHub Desktop.
Save Furzel/9247495 to your computer and use it in GitHub Desktop.
#!/bin/bash
libudev='libudev.so.0'
binary=`./MyApp`
# remove old symlink if exist
if [ -a $libudev ]
then
rm $libudev
fi
# check wether libudev.so.0 can be found on the system
libudev0=`find / -name 'libudev.so*' 2>/dev/null | grep so.0$`
if [ -z $libudev0 ]
then
echo 'libudev0 not found, looking for libudev1'
libudev1=`find / -name 'libudev.so*' 2>/dev/null | grep so.1$`
if [ -z $libudev1 ]
then
echo 'libudev1 not found'
echo '########################################'
echo 'libudev is required, check with your package manager or manually install either libudev0 (preffered ) or libudev1'
echo '########################################'
exit
fi
echo 'libudev1 found, creating a local symlink'
ln -s $libudev1 $libudev
LD_LIBRARY_PATH="$PWD/$libudev:$LD_LIBRARY_PATH" $binary
else
echo 'libudev0 found everything should be fine !'
$binary
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment