Skip to content

Commit f8c19fe

Browse files
committed
Adds usage().
1 parent c6e2fb5 commit f8c19fe

1 file changed

Lines changed: 26 additions & 1 deletion

File tree

nfsexports-setsudoaccess

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,33 @@
11
#!/usr/bin/env bash
22

3+
#---------------------------------------------------------------------
4+
usage ()
5+
{
6+
cat <<EOT
7+
8+
${0##*/}
9+
Script to inject the proper command exceptions into a system's
10+
/etc/sudoers file to allow vagrant to modify /etc/exports for
11+
NFS shared folder use without prompting the user for an
12+
administrator password during \`vagrant up\`.
13+
See: https://docs.vagrantup.com/v2/synced-folders/nfs.html
14+
Has no effect if run repeatedly.
15+
16+
Usage:
17+
bin/${0##*/}
18+
19+
20+
EOT
21+
22+
exit 0
23+
}
24+
if [ "$1" = '-h' ]; then
25+
usage
26+
fi
27+
328
# Make sure only root can run our script
429
if [[ $EUID -ne 0 ]]; then
5-
echo "This script must be run using sudo" 1>&2
30+
echo "!! This script must be run using sudo." 1>&2
631
exit 1
732
fi
833

0 commit comments

Comments
 (0)