Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
21
rated 0 times [  21] [ 0]  / answers: 1 / hits: 71092  / 1 Year ago, mon, march 20, 2023, 12:04:42

Is there an idiomatic way in Ubuntu to run a script only the first time a machine is booted? (EC2).


More From » boot

 Answers
5

No. But you might want to place your script in /etc/init.d/script, and self-delete it:


#!/bin/bash

echo "Bump! I'm your first-boot script."

# Delete self
rm "${0}"

[#37240] Tuesday, March 21, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tusmuumu

Total Points: 195
Total Questions: 122
Total Answers: 104

Location: Oman
Member since Tue, Feb 7, 2023
1 Year ago
;