From 8a0d2fc56feeb04d314a7fd6030bda5ce748b2f6 Mon Sep 17 00:00:00 2001 From: Will Woods Date: Wed, 29 Feb 2012 13:09:57 -0500 Subject: [PATCH] url-lib: make nfs support optional Only include /lib/nfs-lib.sh if it exists, and then only run add_url_handler if nfs-lib was imported. --- modules.d/45url-lib/url-lib.sh | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules.d/45url-lib/url-lib.sh b/modules.d/45url-lib/url-lib.sh index 1fc80a1..043a700 100755 --- a/modules.d/45url-lib/url-lib.sh +++ b/modules.d/45url-lib/url-lib.sh @@ -74,7 +74,7 @@ set_http_header() { ### NFS ############################################################## -. /lib/nfs-lib.sh +[ -e /lib/nfs-lib.sh ] && . /lib/nfs-lib.sh nfs_already_mounted() { local server="$1" path="$2" localdir="" s="" p="" @@ -112,4 +112,4 @@ nfs_fetch_url() { [ -f "$outloc" ] || return 253 echo "$outloc" } -add_url_handler nfs_fetch_url nfs nfs4 +command -v nfs_to_var >/dev/null && add_url_handler nfs_fetch_url nfs nfs4