-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathinit.sh
33 lines (25 loc) · 891 Bytes
/
init.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
if [ ! -d "public/amis-admin/jssdk" ] || [ -z "$(ls -A public/amis-admin/jssdk)" ]; then
echo "Directory does not exist or is empty, executing download_jsjdk.sh"
sh download_jsjdk.sh
else
echo "JS SDK Directory exists and is not empty."
fi
# Remount /etc to allow writing to resolv.conf
# mount -o remount,rw /etc
# Write DNS servers to resolv.conf
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
echo "nameserver 8.8.8.4" >> /etc/resolv.conf
echo "nameserver 2001:4860:4860::8888" >> /etc/resolv.conf
echo "nameserver 2001:4860:4860::8844" >> /etc/resolv.conf
# Remount back to read-only if you want
# mount -o remount,ro /etc
# Path to the .env file
ENV_FILE=".env"
# Check if the .env file exists
if [ -f "$ENV_FILE" ]; then
echo ".env file found. Running 'yao migrate'..."
# Run yao migrate
/usr/local/bin/yao migrate
fi
/usr/local/bin/yao start