mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 07:26:29 +00:00
15 lines
347 B
Bash
15 lines
347 B
Bash
![]() |
#!/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
|