-
-
Notifications
You must be signed in to change notification settings - Fork 59
/
Copy pathrun
executable file
·55 lines (46 loc) · 1.67 KB
/
run
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/with-contenv bash
# shellcheck shell=bash
# permissions
lsiown abc:abc \
/data
# check if ipfs is disabled
if [ -z ${DISABLE_IPFS+x} ]; then
# ipfs migrate check on startup
if [[ -d "/data/.ipfs" ]]; then
echo "[ipfs-upgrade] Checking if fs-repo needs to be upgraded (this may take some time)"
HOME=/data s6-setuidgid abc /usr/bin/fs-repo-migrations -y -to 15
fi
# ipfs config
if [[ ! -d "/data/.ipfs" ]]; then
HOME=/data ipfs init --profile lowpower
lsiown -R abc:abc /data/.ipfs
fi
fi
# link user data to frontend
if [[ ! -L '/emulatorjs/frontend/user' ]]; then
ln -s /data /emulatorjs/frontend/user
fi
# Default profile directory
if [[ ! -d '/config/profile/default' ]]; then
mkdir -p /config/profile/default
echo "input_menu_toggle_gamepad_combo = 3
system_directory = /home/web_user/retroarch/system/" >/config/profile/default/retroarch.cfg
lsiown -R abc:abc /config/profile
fi
if [[ ! -f '/config/profile/profile.json' ]]; then
echo '{}' >/config/profile/profile.json
lsiown -R abc:abc /config/profile
fi
# nginx mime types
cp /defaults/mime.types /etc/nginx/mime.types
# nginx body cache
lsiown -R abc:root /var/lib/nginx
# allow users to mount in ro rom dirs
DIRS='3do atari2600 atari5200 atari7800 colecovision doom gba lynx n64 nes odyssey2 psx segaCD segaMD segaSaturn snes vb ws arcade atari5200 gb gbc jaguar msx nds ngp pce sega32x segaGG segaMS segaSG vectrex'
for DIR in ${DIRS}; do
if [[ -d "/roms/${DIR}" ]] && [[ ! -L "/data/${DIR}/roms" ]]; then
mkdir -p "/data/${DIR}"
ln -s "/roms/${DIR}" "/data/${DIR}/roms"
lsiown abc:abc "/data/${DIR}"
fi
done