Revision [21992]

This is an old revision of AutomaticDiskDriveMountOnFolderAccess made by ToBo on 2015-10-07 21:33:03.

 


We need to check all open files.
sudo watch bash -c 'lsof | grep media'



#!/bin/bash
# Automatic Disk Drive Mount On Folder Access
# Written by Andreas Tobola, Oktober 2015, http://tnotes.de
# Scrip must be run as root to access all open files by any process

FOLDER='/home/actor/media/black'

OPEN_FILES=`lsof +d $FOLDER -b -t | wc -l`

if [ "$OPEN_FILES" -gt "0" ]; then
    echo 'Folder open'
else
    echo 'Folder closed'
fi

echo 'end'



Siehe auch
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki