aboutsummaryrefslogtreecommitdiff
path: root/src/usr/libexec
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2020-09-29 07:02:01 -0400
committerB Stack <bgstack15@gmail.com>2020-09-29 07:02:01 -0400
commit277e602752f52d9142ae82b1d06c10a5fb43834e (patch)
tree4243525f50eb75117deb858dd32ab75f14ada6f8 /src/usr/libexec
parentadd man pages (diff)
downloadmyautomount-277e602752f52d9142ae82b1d06c10a5fb43834e.tar.gz
myautomount-277e602752f52d9142ae82b1d06c10a5fb43834e.tar.bz2
myautomount-277e602752f52d9142ae82b1d06c10a5fb43834e.zip
add makefile, and MYA_PREFIX support to initialize.sh
Diffstat (limited to 'src/usr/libexec')
-rw-r--r--src/usr/libexec/myautomount/myautomount-initialize.sh12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/usr/libexec/myautomount/myautomount-initialize.sh b/src/usr/libexec/myautomount/myautomount-initialize.sh
index e415f18..cbcb5d6 100644
--- a/src/usr/libexec/myautomount/myautomount-initialize.sh
+++ b/src/usr/libexec/myautomount/myautomount-initialize.sh
@@ -9,13 +9,13 @@ fail() {
setupSystem() {
_needrestart=0
- mkdir -m0755 -p "${AUTOMOUNT_DIR}" || fail "Could not setup autofs rules! Check if this is being run as root?"
- ! test -f "${AUTOMOUNT_FILE}" && {
- { touch "${AUTOMOUNT_FILE}" && echo "* -fstype=auto,rw,nosuid,uid=${USER},gid=users :/dev/& " > "${AUTOMOUNT_FILE}" ; } || fail "Could not setup autofs rules! Check if this is being run as root?"
+ mkdir -m0755 -p "${MYA_PREFIX}${AUTOMOUNT_DIR}" || fail "Could not setup autofs rules! Check if this is being run as root?"
+ ! test -f "${MYA_PREFIX}${AUTOMOUNT_FILE}" && {
+ { touch "${MYA_PREFIX}${AUTOMOUNT_FILE}" && echo "* -fstype=auto,rw,nosuid,uid=${USER},gid=users :/dev/& " > "${AUTOMOUNT_FILE}" ; } || fail "Could not setup autofs rules! Check if this is being run as root?"
_needrestart=1
}
- ! test -f "${AUTOMOUNT_DIR_FILE}" && {
- { touch "${AUTOMOUNT_DIR_FILE}" && echo "${AUTOMOUNT_BROWSEDIR} ${AUTOMOUNT_FILE} --timeout=5 " > "${AUTOMOUNT_DIR_FILE}" ; } || fail "Could not setup autofs rules! Check if this is being run as root?"
+ ! test -f "${MYA_PREFIX}${AUTOMOUNT_DIR_FILE}" && {
+ { touch "${MYA_PREFIX}${AUTOMOUNT_DIR_FILE}" && echo "${AUTOMOUNT_BROWSEDIR} ${AUTOMOUNT_FILE} --timeout=5 " > "${AUTOMOUNT_DIR_FILE}" ; } || fail "Could not setup autofs rules! Check if this is being run as root?"
_needrestart=1
}
test ${_needrestart} -eq 1 && eval "service autofs restart"
@@ -23,3 +23,5 @@ setupSystem() {
. ${MYA_PREFIX}/etc/myautomount.conf
setupSystem
+# must enforce exit 0 because otherwise an already-initialized system will end with test ${_needrestart} -eq 1 as false which will break `make`.
+:
bgstack15