From: Will Woods Date: Wed, 29 Feb 2012 18:09:57 +0000 (-0500) Subject: url-lib: make nfs support optional X-Git-Tag: 018~78 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8a0d2fc56feeb04d314a7fd6030bda5ce748b2f6;p=thirdparty%2Fdracut.git 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. --- diff --git a/modules.d/45url-lib/url-lib.sh b/modules.d/45url-lib/url-lib.sh index 1fc80a185..043a700ff 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