mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 15:36:27 +00:00
14 lines
347 B
Bash
Executable file
14 lines
347 B
Bash
Executable file
#!/bin/bash
|
|
|
|
if [ -n "$EC2_USER_DATA" ]; then
|
|
# Check if EC2 user data is a script, if yes, execute
|
|
if [[ $EC2_USER_DATA =~ ^#! ]]; then
|
|
echo "EC2 data is an executable script, so execute it now"
|
|
TMPFILE=$(mktemp /tmp/output.XXXXXXXXXX)
|
|
chmod 755 $TMPFILE
|
|
$TMPFILE
|
|
cat $TMPFILE
|
|
else
|
|
print "Not an executable"
|
|
fi
|
|
fi
|