#!/bin/sh [ -f /etc/lime_release ] && . /etc/lime_release || { echo "LibreMesh version not found in /etc/lime_release - skipping" exit 0 } feeds_file="/etc/opkg/limefeeds.conf" [ -f "$feeds_file" ] && { echo "LibreMesh opkg feeds already defined - skipping" exit 0 } arch_packages="$(grep OPENWRT_ARCH /etc/os-release | sed 's/OPENWRT_ARCH=\"\(.*\)\"/\1/')" [ "$LIME_CODENAME" == "development" ] && { packages_url="http://feed.libremesh.org/master"; arch_packages_url="http://feed.libremesh.org/arch_packages/master/$arch_packages"; } || { packages_url="http://feed.libremesh.org/$LIME_RELEASE" arch_packages_url="http://feed.libremesh.org/arch_packages/$LIME_RELEASE/$arch_packages"; } profiles_url="http://feed.libremesh.org/profiles" key_name="a71b3c8285abd28b" key_content="RWSnGzyChavSiyQ+vLk3x7F0NqcLa4kKyXCdriThMhO78ldHgxGljM/8" echo "Configuring official LibreMesh opkg feeds" echo "src/gz libremesh $packages_url" > "$feeds_file" echo "src/gz libremesh_arch_packages $arch_packages_url" >> "$feeds_file" echo "src/gz profiles $profiles_url" >> "$feeds_file" echo "untrusted comment: signed by libremesh.org key $key_name" > "/etc/opkg/keys/$key_name" echo "$key_content" >> "/etc/opkg/keys/$key_name"