Skip to content

Commit ae542c5

Browse files
committed
1 parent a0ca497 commit ae542c5

1 file changed

Lines changed: 16 additions & 3 deletions

File tree

known-issues/start_daemon.sh

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ exec 3<> ./start_daemon.log
44

55
script_dir="$(readlink /proc/$$/cwd )"
66

7+
die1() {
8+
cd "$script_dir"
9+
grep -q "/cSploit" /proc/mounts && umount /cSploit
10+
test -d /cSploit && { mount -o remount,rw /; rmdir /cSploit; mount -o remount,ro / ;}
11+
echo "$1" >&3
12+
exit 1
13+
}
14+
715
test -f ./issues || { ./known-issues > ./issues 2>&3 ; chmod 777 ./issues ;}
816

917
while read issue; do
@@ -12,9 +20,14 @@ while read issue; do
1220

1321
case issue in
1422
1)
15-
echo "issue #1 found, cSploit will not be started" >&2
16-
exit 1
17-
;;
23+
if [ ! -f "/cSploit/cSploitd" ]; then
24+
mount -o remount,rw / 2>&3 || die1 "remount rw failed"
25+
test -d "/cSploit" || mkdir "/cSploit" 2>&3 || die1 "mkdir failed"
26+
mount -o bind "$script_dir" "/cSploit" 2>&3 || die1 "bind failed"
27+
mount -o remount,ro / 2>&3 || echo "remount ro failed" >&3
28+
fi
29+
cd /cSploit 2>&3 || die1 "chdir failed"
30+
;;
1831

1932
esac
2033
done < ./issues

0 commit comments

Comments
 (0)