-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
32 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,28 @@ | ||
#!/bin/bash | ||
|
||
if [ `id -u` -ne 0 ]; then | ||
echo "Run as root" | ||
echo "Run as root"; | ||
exit 1; | ||
fi | ||
# build and install liblgpio if not found | ||
# if ! $(ldconfig -p | grep -q liblgpio); then | ||
wget https://abyz.me.uk/lg/lg.zip | ||
unzip lg.zip | ||
cd lg | ||
make | ||
make install | ||
ldconfig | ||
cd .. | ||
#else | ||
# echo "liblgpio already installed" | ||
#fi | ||
|
||
# build and install libhx711 if not found | ||
#if ! $(ldconfig -p | grep -q libhx711); then | ||
git clone https://github.com/endail/hx711 | ||
cd hx711 | ||
make | ||
make install | ||
ldconfig | ||
cd .. | ||
#else | ||
# echo "libhx711 already installed" | ||
#fi | ||
# install lgpio from apt if available | ||
apt-get install -y liblgpio-dev; | ||
|
||
# otherwise build and install liblgpio-dev if not found | ||
if ! $(ldconfig -p | grep -q liblgpio); then | ||
wget https://github.com/joan2937/lg/archive/master.zip; | ||
unzip master.zip; | ||
cd lg-master; | ||
make; | ||
make install; | ||
ldconfig; | ||
cd ..; | ||
fi | ||
|
||
# build and install libhx711 | ||
git clone https://github.com/endail/hx711; | ||
cd hx711; | ||
make; | ||
make install; | ||
ldconfig; | ||
cd ..; |