]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
AWS: Add a timestamp to user-data.log
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 5 Dec 2018 14:42:54 +0000 (14:42 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 5 Dec 2018 14:42:54 +0000 (14:42 +0000)
This way, multiple (failed) runs of the script won't
overwrite the log file.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/initscripts/helper/aws-setup

index d79d1c610b2d670e90bcc9076acf4889dd6b1f7e..af6d24c8b4dc54f1a5577b32efc99523f34e31f5 100644 (file)
@@ -107,7 +107,8 @@ import_aws_configuration() {
                        chmod 700 /tmp/aws-user-data.script
 
                        # Run the user-data script
                        chmod 700 /tmp/aws-user-data.script
 
                        # Run the user-data script
-                       /tmp/aws-user-data.script &>/var/log/user-data.log
+                       local now="$(date -u +"%s")"
+                       /tmp/aws-user-data.script &>/var/log/user-data.log.${now}
 
                        # Delete the script right away
                        rm /tmp/aws-user-data.script
 
                        # Delete the script right away
                        rm /tmp/aws-user-data.script