From 83dfe0c9ffa5c4592c0e80601352cc2314ea40e6 Mon Sep 17 00:00:00 2001 From: Mike Crute Date: Sun, 28 Jan 2018 04:52:16 +0000 Subject: Maximize root filesystem --- tiny-ec2-bootstrap | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tiny-ec2-bootstrap b/tiny-ec2-bootstrap index b0e3ca0..84f7af2 100644 --- a/tiny-ec2-bootstrap +++ b/tiny-ec2-bootstrap @@ -52,6 +52,10 @@ _run_userdata() { fi } +_resize_root_partition() { + resize2fs $(mountpoint -n / | cut -d' ' -f1) +} + _scramble_password() { echo "$1:$(head -c 100 /dev/urandom | sha512sum | cut -d' ' -f1)" | chpasswd } @@ -64,6 +68,7 @@ start() { ebegin "Scrambling root password"; _scramble_password root; eend $? ebegin "Scrambling alpine password"; _scramble_password alpine; eend $? + ebegin "Resizing root partition"; _resize_root_partition; eend $? ebegin "Setting ec2 hostname"; _update_hostname; eend $? ebegin "Setting ec2 user ssh keys"; _set_ssh_keys "alpine"; eend $? ebegin "Running ec2 user data script"; _run_userdata; eend $? -- cgit v1.2.3