mirror of
https://github.com/kastdeur/dotfiles.git
synced 2024-12-22 09:13:33 +01:00
40 lines
596 B
Text
40 lines
596 B
Text
|
#!/bin/sh
|
||
|
|
||
|
tmp_file="./tmp_list";
|
||
|
com="upload-to-marietje"
|
||
|
remove="n";
|
||
|
|
||
|
trap "echo Aborted!; exit;" INT TERM
|
||
|
|
||
|
if [ ! -f "$tmp_file" ]; then
|
||
|
touch $tmp_file;
|
||
|
fi
|
||
|
|
||
|
echo "###$(date) - $(id -u -n)" >> $tmp_file;
|
||
|
|
||
|
for f in ./*; do
|
||
|
name=${f##*/}
|
||
|
if [ "$name" = "$0" ]; then continue
|
||
|
elif [ "$name" = "$tmp_file" ]; then continue
|
||
|
fi
|
||
|
|
||
|
echo "$com $f";
|
||
|
# echo |
|
||
|
$com "$f";
|
||
|
if [ "$?" = "0" ]; then
|
||
|
echo "$f" >> $tmp_file;
|
||
|
fi
|
||
|
done
|
||
|
|
||
|
if [ "y$remove" = "yy" ]; then
|
||
|
while read p; do
|
||
|
if [[ "$p" == "###"* ]]; then
|
||
|
break
|
||
|
fi
|
||
|
|
||
|
rm -v \"$p\";
|
||
|
done < tac "$tmp_file";
|
||
|
fi
|
||
|
|
||
|
echo "It's Done!!";
|