A truck load of updates/fixes/tweaks
[pkgusr] / usr / lib / pkgusr / ldconfig
diff --git a/usr/lib/pkgusr/ldconfig b/usr/lib/pkgusr/ldconfig
new file mode 100755 (executable)
index 0000000..15dc1cb
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/bash
+# Copyright (C) 2014 Steve Youngs <steve@steveyoungs.com>
+####
+#
+#  Call ldconfig with sudo to avoid errors and warnings about not
+#  having permission to change /etc/ld.so.cache
+#
+####
+
+if [ -x $(type -p sudo) ]; then
+    sudo /sbin/ldconfig "$@"
+else
+    /sbin/ldconfig "$@" || exit $?
+    echo 1>&2 '***' No sudo available, you need to run ldconfig as root
+fi
+
+exit 0
+
+
+# Local variables:
+# sh-basic-offset: 4
+# End: