Megatest

Hex Artifact Content
Login

Artifact dc233ea2bca90f87b48761aeccf88fde57d1a821:


0000: 23 21 2f 62 69 6e 2f 62 61 73 68 20 2d 65 0a 66  #!/bin/bash -e.f
0010: 72 65 65 73 70 61 63 65 3d 60 64 66 20 2d 6b 20  reespace=`df -k 
0020: 2f 24 44 49 52 45 43 54 4f 52 59 20 7c 20 67 72  /$DIRECTORY | gr
0030: 65 70 20 24 44 49 52 45 43 54 4f 52 59 20 7c 20  ep $DIRECTORY | 
0040: 61 77 6b 20 27 7b 70 72 69 6e 74 20 24 34 7d 27  awk '{print $4}'
0050: 60 0a 69 66 20 5b 5b 20 24 66 72 65 65 73 70 61  `.if [[ $freespa
0060: 63 65 20 2d 6c 74 20 24 52 45 51 55 49 52 45 44  ce -lt $REQUIRED
0070: 20 5d 5d 3b 74 68 65 6e 0a 20 20 65 63 68 6f 20   ]];then.  echo 
0080: 22 45 52 52 4f 52 3a 20 69 6e 73 75 66 66 69 63  "ERROR: insuffic
0090: 69 65 6e 74 20 73 70 61 63 65 20 6f 6e 20 2f 24  ient space on /$
00a0: 44 49 52 45 43 54 4f 52 59 22 0a 20 20 65 78 69  DIRECTORY".  exi
00b0: 74 20 31 0a 65 6c 73 65 0a 20 20 65 63 68 6f 20  t 1.else.  echo 
00c0: 22 54 68 65 72 65 20 69 73 20 61 64 65 71 75 61  "There is adequa
00d0: 74 65 20 73 70 61 63 65 20 6f 6e 20 2f 24 44 49  te space on /$DI
00e0: 52 45 43 54 4f 52 59 22 0a 66 69 0a              RECTORY".fi.