# Copyright (c) 2019 Muntashir Al-Islam. All rights reserved. description "Mount partitions when user has logged in" author "muntashir.islam96@gmail.com" start on start-user-session task script fstab="/usr/local/fstab" # Check for the existence of fstab if [ -e "${fstab}" ]; then # fstab found # Create directories if not exist only if the user is a valid user for mount_point in `cat "${fstab}" | grep -vE "^\s*#" | awk '{print $2}'`; do if ! [ -e "${mount_point}" ] && [ -e `dirname "${mount_point}"` ]; then mkdir -p "${mount_point}" fi done # mount fs, errors don't matter mount -a -T "${fstab}" || true fi end script