]> git.donarmstrong.com Git - bin.git/blob - update_lists
add reset usb bus command
[bin.git] / update_lists
1 #!/bin/bash
2
3 for listdir in lists bugs; do
4     ( cd ~/Maildir;
5         find $listdir -maxdepth 1 -mindepth 1 -type d | \
6             perl -ne 'chomp; $a = $_; $b = $a; $b =~ s/\./_/g; $b =~ s/\//./g; qx(ln -sf "$a" ".$b")';
7     );
8     ( cd ~/Maildir/$listdir; 
9         find . -maxdepth 1 -mindepth 1 -type d| \
10             xargs -n 1 -i bash -c 'A={}; (( $(find "$A" -type f -name "*" -not -name "dovecot*" -not -name ".imap*" -not -name ".customflags" | wc -l) == 0 )) && rm -rf "$A"';
11     );
12 done;
13
14 # Remove broken symlinks
15 (cd ~/Maildir;
16     find . -maxdepth 1 -mindepth 1 -type l -iname '.*' -not -xtype d -delete;
17 );