File tree 2 files changed +8
-7
lines changed
2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -13,9 +13,6 @@ case "$1" in
13
13
[[ $( free | grep Mem | awk ' {print $2}' ) -lt $(( 1024 * 512 )) ]] && swap_size=$(( 1024 * 512 ))
14
14
15
15
if [ -f /root/part ]; then
16
- echo -e " \e[0;37mResizing SD card file-system\x1B[0m"
17
- /sbin/resize2fs -p /dev/${device}${partition} > /dev/null
18
-
19
16
echo -e " \e[0;37mCreating $(( $swap_size / 1024 )) Mb emergency swap area\x1B[0m"
20
17
dd if=/dev/zero of=/swap bs=1024 count=$swap_size status=noxfer > /dev/null 2>&1
21
18
chown root:root /swap
@@ -41,6 +38,10 @@ case "$1" in
41
38
# add part one
42
39
touch /root/part
43
40
41
+ sleep 2
42
+ echo -e " \e[0;37mResizing SD card file-system\x1B[0m"
43
+ /sbin/resize2fs -p /dev/${device}${partition} > /dev/null
44
+
44
45
sleep 2
45
46
shutdown -r now
46
47
fi
Original file line number Diff line number Diff line change @@ -8,15 +8,11 @@ case "$1" in
8
8
device=$( lsblk -in | grep " /$" | cut -d ' -' -f2 | cut -d ' ' -f1 | sed ' s/^\([a-z]*\)\([0-9]*\)\(\w*\)/\1\2/' )
9
9
partition=$( lsblk -in | grep " /$" | cut -d ' -' -f2 | cut -d ' ' -f1 | grep -oP ' (?<=\d)p(\d*)' )
10
10
11
-
12
11
# size swap
13
12
swap_size=131072
14
13
[[ $( free | grep Mem | awk ' {print $2}' ) -lt $(( 1024 * 512 )) ]] && swap_size=$(( 1024 * 512 ))
15
14
16
15
if [ -f /tmp/part ]; then
17
- echo -e " \e[0;37mResizing SD card file-system\x1B[0m"
18
- /sbin/resize2fs -p /dev/${device}${partition} > /dev/null
19
-
20
16
echo -e " \e[0;37mCreating $(( $swap_size / 1024 )) Mb emergency swap area\x1B[0m"
21
17
dd if=/dev/zero of=/swap bs=1024 count=$swap_size status=noxfer > /dev/null 2>&1
22
18
chown root:root /swap
@@ -45,6 +41,10 @@ case "$1" in
45
41
# add part one
46
42
touch /tmp/part
47
43
44
+ sleep 2
45
+ echo -e " \e[0;37mResizing SD card file-system\x1B[0m"
46
+ /sbin/resize2fs -p /dev/${device}${partition} > /dev/null
47
+
48
48
sleep 2
49
49
shutdown -r now
50
50
fi
You can’t perform that action at this time.
0 commit comments