mirror of
https://github.com/AlbrechtL/openwrt-docker.git
synced 2026-10-17 08:01:35 +00:00
Sync
This commit is contained in:
+4
-2
@@ -24,6 +24,7 @@ if [ -f "${DATA}" ]; then
|
||||
|
||||
if [ "$ALLOCATE" = "N" ]; then
|
||||
|
||||
# Resize file by changing its length
|
||||
truncate -s "${DATA_SIZE}" "${DATA}";
|
||||
|
||||
else
|
||||
@@ -38,6 +39,7 @@ if [ -f "${DATA}" ]; then
|
||||
echo "ERROR: Specify a smaller size or disable preallocation with ALLOCATE=N." && exit 84
|
||||
fi
|
||||
|
||||
# Resize file by allocating more space
|
||||
if ! fallocate -l "${DATA_SIZE}" "${DATA}"; then
|
||||
echo "ERROR: Could not allocate a file for the data disk." && exit 85
|
||||
fi
|
||||
@@ -65,10 +67,9 @@ fi
|
||||
|
||||
if [ ! -f "${DATA}" ]; then
|
||||
|
||||
# Create an empty file
|
||||
|
||||
if [ "$ALLOCATE" = "N" ]; then
|
||||
|
||||
# Create an empty file
|
||||
truncate -s "${DATA_SIZE}" "${DATA}"
|
||||
|
||||
else
|
||||
@@ -81,6 +82,7 @@ if [ ! -f "${DATA}" ]; then
|
||||
echo "ERROR: Specify a smaller size or disable preallocation with ALLOCATE=N." && exit 86
|
||||
fi
|
||||
|
||||
# Create an empty file
|
||||
if ! fallocate -l "${DATA_SIZE}" "${DATA}"; then
|
||||
rm -f "${DATA}"
|
||||
echo "ERROR: Could not allocate a file for the data disk." && exit 87
|
||||
|
||||
Reference in New Issue
Block a user