Skip to content

Commit 9d529f4

Browse files
authored
Update ampstart.sh
Add ability to run scripts on instance startup. The file must be named `customstart.sh` and be placed in the root instance directory.
1 parent 942f2b4 commit 9d529f4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

scripts/ampstart.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ if [ -n "$AMP_MOUNTPOINTS" ]; then
6262
done
6363
fi
6464

65+
if [ -f "/AMP/customstart.sh" ]; then
66+
echo "[Info] Running customstart.sh..."
67+
chmod +x /AMP/customstart.sh
68+
/AMP/customstart.sh
69+
fi
70+
6571
export AMPHOSTPLATFORM
6672
export AMP_CONTAINER
6773
export AMPMEMORYLIMIT
@@ -71,4 +77,4 @@ export AMP_CONTAINER_HOST_NETWORK
7177

7278
ARGS=$@
7379
exec su -l -w AMPHOSTPLATFORM,AMP_CONTAINER,AMPMEMORYLIMIT,AMP_CONTAINER_HOST_NETWORK,AMPSWAPLIMIT,AMPCONTAINERCPUS -c "ampinstmgr --sync-certs; cd /AMP; HOME=/home/amp /AMP/AMP_Linux_$ARCH ${ARGS}; exit $?" -- amp
74-
exit $?
80+
exit $?

0 commit comments

Comments
 (0)