Welcome to mirror list, hosted at ThFree Co, Russian Federation.

chmenu « bin « rootfs « hakchi « mod - github.com/ClusterM/hakchi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3ad32b84453892524c635299434098c500a28302 (plain)
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
#!/bin/sh
source /etc/preinit
script_init

state_file="$installpath/menu"

[ -z "$1" ] && exit 1
[ -f "$state_file" ] && prev_code="$(cat "$state_file")" || prev_code="000"
[ "$1" == "$prev_code" ] && exit 1

echo "Switching to menu $1"
if [ "$1" == "000" ]; then
  targetpath="$rootfs$gamepath"
else
  targetpath="$rootfs$gamepath/$1"
fi

[ -d "$targetpath" ] || exit 1
echo "$1" > "$state_file"

echo "New directory: $targetpath"

if [ "$1" != "000" ]; then
  if [ -f "$rootfs$gamepath/title.fnt" ] && [ ! -f "$targetpath/title.fnt" ]; then
    ln -s "$rootfs$gamepath/title.fnt" "$targetpath/title.fnt"
  fi
  if [ -f "$rootfs$gamepath/copyright.fnt" ] && [ ! -f "$targetpath/copyright.fnt" ]; then
    ln -s "$rootfs$gamepath/copyright.fnt" "$targetpath/copyright.fnt"
  fi
fi

uistop
overmount_games
sleep 1
touch "/var/startmcp.flag"