Skip to content

Commit

Permalink
Update install scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
rossharper committed May 2, 2020
1 parent 0372151 commit 5e8392b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ callforheat: $(objects) callforheat.o
$(CXX) $(CXXFLAGS) $(LDFLAGS) $+ -o $@ $(LDLIBS)

install:
cp -p $(STATIC_LIBRARY) $(INSTALLDIR)
cp -p $(DYNAMIC_LIBRARY) $(INSTALLDIR)
mkdir -p $(HEADERSINSTALLDIR)
cp -p $(EXPORTHEADERS) $(HEADERSINSTALLDIR)
chown root callforheat
chmod 4755 callforheat
cp -p callforheat $(EXECINSTALLDIR)
sudo cp -p $(STATIC_LIBRARY) $(INSTALLDIR)
sudo cp -p $(DYNAMIC_LIBRARY) $(INSTALLDIR)
sudo mkdir -p $(HEADERSINSTALLDIR)
sudo cp -p $(EXPORTHEADERS) $(HEADERSINSTALLDIR)
chmod a+x callforheat
sudo cp -p callforheat $(EXECINSTALLDIR)
ifeq ($(PLATFORM),pi)
chmod 4755 gpio-init.sh
chmod a+x gpio-init.sh
sh gpio-init.sh
sh installStartupGpioConfig.sh
endif

Expand Down
2 changes: 1 addition & 1 deletion gpio-init.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#! /bin/bash
gpio export 17 out
gpio write 17 0 ; gpio export 17 out
exit 0
3 changes: 1 addition & 2 deletions installStartupGpioConfig.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
cp gpio-init.sh /etc/init.d/
update-rc.d gpio-init.sh defaults
sudo sed -i.bak -e 's/^exit 0/#Set pin 17 for output and low\nPATH=\/bin:\/usr\/bin\ngpio write 17 0 ; gpio export 17 out\n\nexit 0/' /etc/rc.local
4 changes: 3 additions & 1 deletion unInstallStartupGpioConfig.sh
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
update-rc.d -f gpio-init.sh remove
sudo sed -i.bak -e 's/^#Set pin 17 for output and low//' \
-e 's/^PATH=\/bin:\/usr\/bin//' \
-e 's/^gpio write 17 0 ; gpio export 17 out//' /etc/rc.local

0 comments on commit 5e8392b

Please sign in to comment.