diff options
-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 |