aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Crute <mike@crute.us>2018-01-28 04:52:16 +0000
committerMike Crute <mike@crute.us>2018-01-28 04:52:16 +0000
commit83dfe0c9ffa5c4592c0e80601352cc2314ea40e6 (patch)
tree3de89381d1bc8913b52ae28f21cac975a820ddd7
parentfe26bc91ff84f86cca6aa8e1c0940ff45c8181b8 (diff)
downloadtiny-ec2-bootstrap-83dfe0c9ffa5c4592c0e80601352cc2314ea40e6.tar.bz2
tiny-ec2-bootstrap-83dfe0c9ffa5c4592c0e80601352cc2314ea40e6.tar.xz
tiny-ec2-bootstrap-83dfe0c9ffa5c4592c0e80601352cc2314ea40e6.zip
Maximize root filesystem
-rw-r--r--tiny-ec2-bootstrap5
1 files changed, 5 insertions, 0 deletions
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() {
52 fi 52 fi
53} 53}
54 54
55_resize_root_partition() {
56 resize2fs $(mountpoint -n / | cut -d' ' -f1)
57}
58
55_scramble_password() { 59_scramble_password() {
56 echo "$1:$(head -c 100 /dev/urandom | sha512sum | cut -d' ' -f1)" | chpasswd 60 echo "$1:$(head -c 100 /dev/urandom | sha512sum | cut -d' ' -f1)" | chpasswd
57} 61}
@@ -64,6 +68,7 @@ start() {
64 68
65 ebegin "Scrambling root password"; _scramble_password root; eend $? 69 ebegin "Scrambling root password"; _scramble_password root; eend $?
66 ebegin "Scrambling alpine password"; _scramble_password alpine; eend $? 70 ebegin "Scrambling alpine password"; _scramble_password alpine; eend $?
71 ebegin "Resizing root partition"; _resize_root_partition; eend $?
67 ebegin "Setting ec2 hostname"; _update_hostname; eend $? 72 ebegin "Setting ec2 hostname"; _update_hostname; eend $?
68 ebegin "Setting ec2 user ssh keys"; _set_ssh_keys "alpine"; eend $? 73 ebegin "Setting ec2 user ssh keys"; _set_ssh_keys "alpine"; eend $?
69 ebegin "Running ec2 user data script"; _run_userdata; eend $? 74 ebegin "Running ec2 user data script"; _run_userdata; eend $?