[PATCH] url-lib: make nfs support optional

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 383e7ac..7b669f4 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
-- 
1.7.7.6

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux