Skip to content

Commit

Permalink
packages: play nice with host OPKG and INSTROOT
Browse files Browse the repository at this point in the history
(cherry picked from commit 77312c679be7258b249ef48226b6d921f06d3959)
  • Loading branch information
pktpls committed Sep 24, 2024
1 parent 906d69c commit 74ac6a8
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 6 deletions.
4 changes: 3 additions & 1 deletion packages/falter-berlin-admin-keys/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ endef

define Package/falter-berlin-admin-keys/postinst
#!/bin/sh
$${IPKG_INSTROOT}/tmp/falter-berlin-admin-keys/register_keys.sh
if [ -z $${IPKG_INSTROOT} ] ; then
/tmp/falter-berlin-admin-keys/register_keys.sh
fi
endef

$(eval $(call BuildPackage,falter-berlin-admin-keys))
4 changes: 2 additions & 2 deletions packages/falter-berlin-admin-keys/files/register_keys.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ KEY_FILES=$(find "$SCRIPTPATH" -name "*.pub")

for KEY_FILE in $KEY_FILES; do
KEY=$(cat $KEY_FILE)
if [ -z "$(grep "$KEY" $IPKG_INSTROOT/etc/dropbear/authorized_keys)" ]; then
echo "$KEY" >> $IPKG_INSTROOT/etc/dropbear/authorized_keys
if [ -z "$(grep "$KEY" /etc/dropbear/authorized_keys)" ]; then
echo "$KEY" >> /etc/dropbear/authorized_keys
fi
done
3 changes: 2 additions & 1 deletion packages/falter-berlin-autoupdate/files/post-inst.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/sh
#

[ -z $IPKG_INSTROOT ] || exit 0

# if autoupdate is not present in crontab, include it.
crontab -l | grep /usr/bin/autoupdate >>/dev/null
Expand Down
4 changes: 3 additions & 1 deletion packages/falter-berlin-bbbdigger/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ endef

define Package/falter-berlin-bbbdigger/postinst
#!/bin/sh
$${IPKG_INSTROOT}/tmp/falter-berlin-bbbdigger_postinst.sh
if [ -z $${IPKG_INSTROOT} ] ; then
/tmp/falter-berlin-bbbdigger_postinst.sh
fi
endef

$(eval $(call BuildPackage,falter-berlin-bbbdigger))
2 changes: 2 additions & 0 deletions packages/falter-berlin-bbbdigger/files/postinst.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#
# All other config sections are overwritten with current settings

[ -z $IPKG_INSTROOT ] || exit 0

. /lib/functions.sh

TUNNEL_SRV='_bbb-vpn._udp.berlin.freifunk.net'
Expand Down
3 changes: 2 additions & 1 deletion packages/falter-berlin-ssid-changer/files/post-inst.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/sh
#

[ -z $IPKG_INSTROOT ] || exit 0

# if ssid-changer is not present in crontab, include it.
crontab -l | grep ssid-changer >>/dev/null
Expand Down

0 comments on commit 74ac6a8

Please sign in to comment.