Skip to content

Instantly share code, notes, and snippets.

@Gowee
Created April 16, 2022 07:06
Show Gist options
  • Save Gowee/c50ff5d3a4c03be4ed1b4ade94fdc240 to your computer and use it in GitHub Desktop.
Save Gowee/c50ff5d3a4c03be4ed1b4ade94fdc240 to your computer and use it in GitHub Desktop.
Openwrt get telegraf
#!/bin/sh
set -eux
cd /tmp
filename=$(opkg update && opkg info telegraf | grep "Filename:" | cut -d' ' -f2)
repo=$(cat /etc/opkg/distfeeds.conf | grep "openwrt_packages" | cut -d' ' -f3)
url="$repo/$filename"
wget -q $url
tar xOzf $filename ./data.tar.gz | tar xOzf - ./usr/bin/telegraf > telegraf
chmod +x telegraf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment