diff options
author | Florian Pritz <bluewind@xinu.at> | 2012-01-04 15:42:12 +0100 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2012-01-04 15:43:41 +0100 |
commit | bcb55411af16c89a633c2e7c8e04769766a9fec7 (patch) | |
tree | 4566beeeaa32d4b76c8be464b09856ab6e24147a /fb.in | |
parent | a604f22b6c5afd3204d2e99d78f863736a795202 (diff) |
fix stat calls on non-gnu systems
Reported-by: Moritz Wilhelmy <moritz+git@wzff.de>
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'fb.in')
-rw-r--r-- | fb.in | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -24,6 +24,8 @@ CLIPBOARD="" EXITCODE=0 LIBDIR="@LIBDIR@" +source "$LIBDIR/functions" + require_executable() { if ! type $1 >/dev/null; then echo "Error: $1 not found. Please install." >&2 @@ -87,9 +89,9 @@ do_upload() { fi TMPFILE=`mktemp "$TMPDIR/data.XXXXXX"` - if [ `stat -c %s -- "$file"` -gt "$WARNSIZE" ]; then + if [ `$STAT -- "$file"` -gt "$WARNSIZE" ]; then WARNSIZE=`$LIBDIR/fb-helper d "$PASTEBIN/file/get_max_size"` - if [ `stat -c %s -- "$file"` -gt "$WARNSIZE" ]; then + if [ `$STAT -- "$file"` -gt "$WARNSIZE" ]; then echo "Warning: Your upload is too big and would be rejected. Maximum size is: $WARNSIZE bytes. Skipping..." >&2 return 1 fi |