summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Pouzenc <ludovic@pouzenc.fr>2016-12-24 15:42:01 +0100
committerLudovic Pouzenc <ludovic@pouzenc.fr>2016-12-24 15:42:01 +0100
commitd170454b99044716b684f395c922765d9761e91e (patch)
tree0fce2f9e4444d76ccb82f4a2b3b32c5a5efa52b1
parentf208bf4c3dfb1bc72339378722259529d81c2f47 (diff)
downloadeficast-d170454b99044716b684f395c922765d9761e91e.tar.gz
eficast-d170454b99044716b684f395c922765d9761e91e.tar.bz2
eficast-d170454b99044716b684f395c922765d9761e91e.zip
sinkdo : no stdout pollution (ncurses). uftp : no tmp dir.
-rwxr-xr-xmake-boot-image.sh23
1 files changed, 11 insertions, 12 deletions
diff --git a/make-boot-image.sh b/make-boot-image.sh
index c1a31c7..8e32311 100755
--- a/make-boot-image.sh
+++ b/make-boot-image.sh
@@ -365,9 +365,9 @@ network_show() {
}
start_uftpd() {
- # -I workaround bug "address already in use"
- uftpd -q -B 2097152 -x2 -F /run/uftpd.csv -L /run/uftpd.log -T /tmp -D /run/uftpd -M ff02::42 -I 2/6
- [ $? -eq 0 ] && netstat -nlu | grep -q ':1044 ' && echo -e '\033[42m' ----- UFTPD ready ----- '\033[40m'
+ # FIXME : -I is there as a bug workaround "address already in use"
+ uftpd -q -B 2097152 -x2 -F /run/uftpd.csv -L /run/uftpd.log -t -D /run/uftpd -M ff02::42 -I 2/6
+ [ $? -eq 0 ] && netstat -nlu | grep -q ':1044 ' && echo -e '\033[42m' ----- UFTPD ready ----- '\033[0m'
}
EOF
@@ -440,15 +440,15 @@ fi
while true
do
- f=$(ls | head -n1)
+ f=$(ls | grep -v '~' | head -n1)
if [ -n "$f" ]
then if [ -f "$f" -a -r "$f" ]
then size=$(stat -c'%s' -- "$f")
# Do the actual work on the following line
- cat -- "$f" && rm -v -- "$f" >&2
+ cat -- "$f" && rm -- "$f" >&2
# Normal exit condition
if [ $size -eq 0 ]
- then cd / && rmdir -v -- "$SINKDIR" >&2
+ then cd / && rmdir -- "$SINKDIR" >&2
exit 0
fi
else echo "'$SINKDIR/$f' is not a readable file" >&2
@@ -477,7 +477,7 @@ cd "$LANDDIR" || exit 2
curtask="(start)"
while true
do
- f=$(ls | head -n1)
+ f=$(ls | grep -v '~' | head -n1)
if [ -z "$f" ]
then sleep 1
continue
@@ -490,7 +490,7 @@ do
task=${f:0:2}
if [ "$curtask" == "$task" ]
then # Next file of an already started task
- mv "$f" "$SINKDIR/"
+ mv -- "$f" "$SINKDIR/"
else # Switch to the next task
if [ -d "$SINKDIR" ]
then # Inform sinkcat about end-of-data
@@ -506,15 +506,14 @@ do
curtask=$task
if [ "$task" == "99" ]
then # Normal exit condition
- rm -v "$f" >&2
- # reset # Usefull if ncurses on bg, anoying when destroying useful messages
- echo "All task completed sucessfully" >&2
+ rm -- "$f" >&2
+ echo "All tasks completed sucessfully" >&2
exit 0
else # Start a new task
chmod +x -- "$f" # XXX Checks on $f (is a script ?)
sinkcat $SINKDIR | "./$f" &
while [ ! -d "$SINKDIR" ]; do sleep 1; done
- rm -v "$f" >&2
+ rm -- "$f" >&2
fi
fi
done