blob: 2d9c874a63d263438c0bbc6ae54d5b20ebd8e285 (
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
#!/bin/bash
DVD_DEVICE="/dev/sr0"
MOUNT_POINT="/mnt/monggle_dvd"
AUTORUN_TMP="/tmp/monggle_autorun.sh"
mkdir -p "$MOUNT_POINT"
mount "$DVD_DEVICE" "$MOUNT_POINT"
AUTORUN_SRC="$MOUNT_POINT/autorun.sh"
# ์ธ์ด ๊ฐ์ง
if [[ "$LANG" == en* ]]; then
if [ -f "$AUTORUN_SRC" ]; then
echo "Monggle: autorun.sh found! Running it now..."
cp "$AUTORUN_SRC" "$AUTORUN_TMP"
else
echo "Monggle: autorun.sh not found. Generating default template..."
cat <<EOF > "$AUTORUN_TMP"
#!/bin/bash
notify-send "Monggle autorun template running!" "Please edit this script!"
xdg-open "https://your-site-or-project.com"
EOF
chmod +x "$AUTORUN_TMP"
sudo -u $USER x-terminal-emulator -e vim "$AUTORUN_TMP"
fi
while true; do
sudo -u $USER DISPLAY=:0 "$AUTORUN_TMP"
CODE=$?
if [ "$CODE" -eq 0 ]; then
notify-send "Monggle Success!" "autorun.sh ran successfully ๐"
break
else
notify-send "Monggle Error ๐ข" "autorun.sh failed... reopening vim"
sleep 1
sudo -u $USER x-terminal-emulator -e vim "$AUTORUN_TMP"
fi
done
else
if [ -f "$AUTORUN_SRC" ]; then
echo "๋ชฝ๊ธ์ด: autorun.sh ๋ฐ๊ฒฌ! ๋ณต์ฌ ์ค~"
cp "$AUTORUN_SRC" "$AUTORUN_TMP"
else
echo "๋ชฝ๊ธ์ด: autorun.sh ์์! ํ
ํ๋ฆฟ ์์ฑ!"
cat <<EOF > "$AUTORUN_TMP"
#!/bin/bash
# ๋ชฝ๊ธ์ด autorun ํ
ํ๋ฆฟ!
notify-send "๋ชฝ๊ธ๋ชฝ๊ธ autorun ์คํ!" "์ฌ๊ธฐ ๋ด์ฉ์ ์ฑ์๋ณด์ธ์~"
xdg-open "https://your-site-or-project.com"
EOF
chmod +x "$AUTORUN_TMP"
sudo -u $USER x-terminal-emulator -e vim "$AUTORUN_TMP"
fi
while true; do
echo "๋ชฝ๊ธ์ด: autorun ์คํ ์๋ ์ค..."
sudo -u $USER DISPLAY=:0 "$AUTORUN_TMP"
CODE=$?
if [ "$CODE" -eq 0 ]; then
notify-send "๋ชฝ๊ธ์ด ์ฑ๊ณต!" "autorun์ด ๋ฌธ์ ์์ด ์คํ๋์ด์~ ๐"
echo "๋ชฝ๊ธ๋ชฝ๊ธ~ ์ฑ๊ณต!"
break
else
notify-send "๋ชฝ๊ธ์ด ์ธ์โฆ ๐ญ" "์ค๋ฅ ๋ฐ์! ๋ค์ vim์ผ๋ก ์ด๊ฒ์!"
echo "์๋ฌ ์ฝ๋: $CODE"
sleep 1
sudo -u $USER x-terminal-emulator -e vim "$AUTORUN_TMP"
fi
done
fi
umount "$MOUNT_POINT"
|