Skip to content

Commit c55c201

Browse files
Fix permissions during installation
1 parent edd82e4 commit c55c201

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Makefile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
OBJS= houserelays.o houserelays_config.o houserelays_gpio.o
33
LIBOJS=
44

5+
SHARE=/usr/local/share/house
6+
57
all: houserelays
68

79
main: houserelays.o
@@ -27,10 +29,11 @@ install:
2729
cp init.debian /etc/init.d/houserelays
2830
chown root:root /usr/local/bin/houserelays /etc/init.d/houserelays
2931
chmod 755 /usr/local/bin/houserelays /etc/init.d/houserelays
30-
mkdir -p /usr/local/share/house/public/relays
31-
cp public/* /usr/local/share/house/public/relays
32-
chown root:root /usr/local/share/house/public/relays/*
33-
chmod 644 /usr/local/share/house/public/relays/*
32+
mkdir -p $(SHARE)/public/relays
33+
chmod 755 $(SHARE) $(SHARE)/public $(SHARE)/public/relays
34+
cp public/* $(SHARE)/public/relays
35+
chown root:root $(SHARE)/public/relays/*
36+
chmod 644 $(SHARE)/public/relays/*
3437
if [ ! -e /etc/house/relays.json ] ; then cp config.json /etc/house/relays.json ; fi
3538
chown root:root /etc/house/relays.json
3639
chmod 755 /etc/house/relays.json

0 commit comments

Comments
 (0)