]> diplodocus.org Git - nmh/commitdiff
On FreeBSD, use fetch(1) to retrieve external content through URLs.
authorLyndon Nerenberg <lyndon@orthanc.ca>
Sun, 5 Oct 2014 08:20:56 +0000 (01:20 -0700)
committerLyndon Nerenberg <lyndon@orthanc.ca>
Sun, 5 Oct 2014 08:20:56 +0000 (01:20 -0700)
fetch(1) is part of the base system, so it's guaranteed to always be there.
And it is more likely to have been configured for any local site
customizations (local caches, proxies, etc).

etc/mhn.defaults.sh

index 298dae6..28d113a 100755 (executable)
@@ -314,10 +314,17 @@ fi
 
 # This entry is used to retrieve external-body types that use a "url"
 # access-type.
-PGM=`$SEARCHPROG "$SEARCHPATH" curl`
-if [ ! -z "$PGM" ]; then
-       echo "nmh-access-url: $PGM -L" >> $TMP
-fi
+case "`uname`" in
+  FreeBSD)
+       echo "nmh-access-url: fetch -a" >> $TMP
+       ;;
+  *)
+       PGM=`$SEARCHPROG "$SEARCHPATH" curl`
+       if [ ! -z "$PGM" ]; then
+               echo "nmh-access-url: $PGM -L" >> $TMP
+       fi
+       ;;
+esac
 
 # output a sorted version of the file
 sort < $TMP