diff options
author | Florian Pritz <f-p@gmx.at> | 2009-02-02 10:10:41 +0100 |
---|---|---|
committer | Florian Pritz <f-p@gmx.at> | 2009-02-02 10:10:41 +0100 |
commit | 1978be4439657a04d2e23227f5c66bb7d4124c18 (patch) | |
tree | 134fffe3e232fbf3435bcdf38e015d11e85b852f | |
parent | bfe28d7b3ca349968521dd527d984882baf256c2 (diff) | |
download | bin-1978be4439657a04d2e23227f5c66bb7d4124c18.tar.gz bin-1978be4439657a04d2e23227f5c66bb7d4124c18.tar.xz |
updated
-rwxr-xr-x | check.sh | 11 | ||||
-rwxr-xr-x | drop.sh | 5 | ||||
-rwxr-xr-x | update_checker.sh | 15 |
3 files changed, 31 insertions, 0 deletions
diff --git a/check.sh b/check.sh new file mode 100755 index 0000000..f129159 --- /dev/null +++ b/check.sh @@ -0,0 +1,11 @@ +#!/bin/sh +# uses pacman to check if a file belongs to any installed package +for file in "$@" +do + if [ -d "$file" ]; then + continue + fi + files=$files" $file" +done + +pacman -Qo $files > /dev/null @@ -0,0 +1,5 @@ +#!/bin/sh +if echo "$1" | grep ".torrent$" > /dev/null +then + mv "$1" /mnt/mistral/flo/torrent/watch +fi diff --git a/update_checker.sh b/update_checker.sh new file mode 100755 index 0000000..bee0543 --- /dev/null +++ b/update_checker.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +cmd="pacman -Qu" +pac_num=$($cmd | grep -o "Targets ([0-9]*)" | sed 's/Targets (//; s/)//') +#$cmd | grep "Total Download Size: .*MB" | grep -o "[0-9].*" + +if [ ! $pac_num ]; then + pac_num=0 +fi + +if [ $pac_num -gt 0 ]; then + echo "${HOSTNAME}: $pac_num" +else + echo "${HOSTNAME}: ok" +fi |