Automatic shares: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
(Die Seite wurde neu angelegt: „=installation iwatch= *iwatch“) |
|||
| (2 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
| Zeile 1: | Zeile 1: | ||
=installation iwatch= | =installation iwatch= | ||
*[[iwatch]] | *[[iwatch]] | ||
| + | =samba script= | ||
| + | */usr/local/sbin/dir-watch | ||
| + | <pre> | ||
| + | #!/bin/bash | ||
| + | EVENT=$(echo $1 | cut -f 2 -d ,) | ||
| + | SMBPATH=$2 | ||
| + | SHARE=$(basename $2) | ||
| + | case $EVENT in | ||
| + | IN_CREATE|IN_MOVED_TO) | ||
| + | echo $EVENT $SMBPATH >> /tmp/iwatch | ||
| + | net conf addshare $SHARE $SMBPATH writeable=y guest_ok=n "SHARE share" | ||
| + | ;; | ||
| + | IN_DELETE|IN_MOVED_FROM) | ||
| + | echo $EVENT $SMPATH >> /tmp/iwatch | ||
| + | net conf delshare $SHARE | ||
| + | ;; | ||
| + | esac | ||
| + | </pre> | ||
Aktuelle Version vom 26. Juni 2014, 14:36 Uhr
installation iwatch
samba script
- /usr/local/sbin/dir-watch
#!/bin/bash EVENT=$(echo $1 | cut -f 2 -d ,) SMBPATH=$2 SHARE=$(basename $2) case $EVENT in IN_CREATE|IN_MOVED_TO) echo $EVENT $SMBPATH >> /tmp/iwatch net conf addshare $SHARE $SMBPATH writeable=y guest_ok=n "SHARE share" ;; IN_DELETE|IN_MOVED_FROM) echo $EVENT $SMPATH >> /tmp/iwatch net conf delshare $SHARE ;; esac