diff options
author | B. Stack <bgstack15@gmail.com> | 2023-10-04 16:43:25 -0400 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2023-10-04 16:43:25 -0400 |
commit | bec3fe5e41aba343b4397fd897d6cb9b6c0a0463 (patch) | |
tree | 847549bdd43109a8256251719ca0408cd271b815 /src/usr/libexec | |
parent | v0.0.2 improve autofs flags to handle ext4 mounts (diff) | |
download | myautomount-bec3fe5e41aba343b4397fd897d6cb9b6c0a0463.tar.gz myautomount-bec3fe5e41aba343b4397fd897d6cb9b6c0a0463.tar.bz2 myautomount-bec3fe5e41aba343b4397fd897d6cb9b6c0a0463.zip |
v0.0.3 add fs_type to automount path
Diffstat (limited to 'src/usr/libexec')
-rw-r--r-- | src/usr/libexec/myautomount/myautomount-initialize.sh | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/usr/libexec/myautomount/myautomount-initialize.sh b/src/usr/libexec/myautomount/myautomount-initialize.sh index 8d47bdd..1194ed5 100644 --- a/src/usr/libexec/myautomount/myautomount-initialize.sh +++ b/src/usr/libexec/myautomount/myautomount-initialize.sh @@ -11,18 +11,29 @@ fail() { setupSystem() { _needrestart=0 mkdir -m0755 -p "${MYA_PREFIX}${AUTOMOUNT_DIR}" || fail "Could not setup autofs rules! Check if this is being run as root?" - ! grep -q -e "uid=${AUTOMOUNT_USER}," "${MYA_PREFIX}${AUTOMOUNT_FILE}" 2>/dev/null && { + ! grep -q -e "uid=${AUTOMOUNT_USER}," "${MYA_PREFIX}${AUTOMOUNT_FILE}.fat32" 2>/dev/null && { { touch "${MYA_PREFIX}${AUTOMOUNT_FILE}" echo "# for fat32, ntfs" echo "* -fstype=auto,noatime,rw,nosuid,uid=${AUTOMOUNT_USER},gid=users :/dev/& " + } > "${MYA_PREFIX}${AUTOMOUNT_FILE}.fat32" || fail "Could not setup autofs rules! Check if this is being run as root?" + _needrestart=1 + } + ! grep -q -e "fstype=auto,noatime" "${MYA_PREFIX}${AUTOMOUNT_FILE}.ext4" 2>/dev/null && { + { echo "# for ext4" echo "* -fstype=auto,noatime,rw,nosuid :/dev/& " - } > "${MYA_PREFIX}${AUTOMOUNT_FILE}" || fail "Could not setup autofs rules! Check if this is being run as root?" + } > "${MYA_PREFIX}${AUTOMOUNT_FILE}.ext4" || fail "Could not setup autofs rules! Check if this is being run as root?" _needrestart=1 } ! grep -q -e "${AUTOMOUNT_BROWSEDIR}" "${MYA_PREFIX}${AUTOMOUNT_DIR_FILE}" 2>/dev/null && { - { touch "${MYA_PREFIX}${AUTOMOUNT_DIR_FILE}" && echo "${AUTOMOUNT_BROWSEDIR} ${AUTOMOUNT_FILE} --timeout=5 " > "${MYA_PREFIX}${AUTOMOUNT_DIR_FILE}" ; } || fail "Could not setup autofs rules! Check if this is being run as root?" + { + touch "${MYA_PREFIX}${AUTOMOUNT_DIR_FILE}" + echo "${AUTOMOUNT_BROWSEDIR}/ext4 ${AUTOMOUNT_FILE}.ext4 --timeout=5 " + echo "${AUTOMOUNT_BROWSEDIR}/fat32 ${AUTOMOUNT_FILE}.fat32 --timeout=5 " + echo "${AUTOMOUNT_BROWSEDIR}/ntfs ${AUTOMOUNT_FILE}.fat32 --timeout=5 " + echo "#${AUTOMOUNT_BROWSEDIR} ${AUTOMOUNT_FILE} --timeout=5 " + } > "${MYA_PREFIX}${AUTOMOUNT_DIR_FILE}" || fail "Could not setup autofs rules! Check if this is being run as root?" _needrestart=1 } test ${_needrestart} -eq 1 && test -z "${MYA_SKIP_RESTART}" && eval "service autofs restart" |