@@ -15,10 +15,10 @@ remountRW() {
15
15
RESU=$?
16
16
INITIAL_STATUS=ro
17
17
if [ " $RESU " != " 0" ] ; then
18
- mount -o remount,rw ${HDD_LOG}
18
+ mount -o remount,rw ${HDD_LOG}
19
19
else
20
- INITIAL_STATUS=rw
21
- rm $HDD_LOG /$$ 2> /dev/null
20
+ INITIAL_STATUS=rw
21
+ rm $HDD_LOG /$$ 2> /dev/null
22
22
fi
23
23
# for return
24
24
echo $INITIAL_STATUS
@@ -91,14 +91,14 @@ make_log_dir () {
91
91
# if create mount failed, try to remount in rw the parent directory
92
92
# and restore original status
93
93
if [ ! -d $HDD_LOG / ] ; then
94
- mkdir $HDD_LOG / 2> /dev/null /dev/null
95
- RESU=$?
96
- if [ " $RESU " -ne " 0" ] ; then
97
- MOUNT_POINT=$( findmnt -T ` dirname $HDD_LOG / ` -n --raw | cut -d ' ' -f 1 )
98
- mount -o remount,rw ${MOUNT_POINT}
99
- sleep 0.1
100
- mkdir $HDD_LOG /
101
- mount -o remount,ro ${MOUNT_POINT}
94
+ mkdir $HDD_LOG / 2> /dev/null /dev/null
95
+ RESU=$?
96
+ if [ " $RESU " -ne " 0" ] ; then
97
+ MOUNT_POINT=$( findmnt -T ` dirname $HDD_LOG / ` -n --raw | cut -d ' ' -f 1 )
98
+ mount -o remount,rw ${MOUNT_POINT}
99
+ sleep 0.1
100
+ mkdir $HDD_LOG /
101
+ mount -o remount,ro ${MOUNT_POINT}
102
102
fi
103
103
fi
104
104
}
@@ -112,8 +112,10 @@ case "$1" in
112
112
RAM_LOG=$i
113
113
HDD_LOG=$PATH_FIRST_PART /hdd.$PATH_LAST_PART
114
114
LOG2RAM_LOG=" ${RAM_LOG} /${LOG_NAME} "
115
- make_log_dir
116
- mount --bind $RAM_LOG / $HDD_LOG /
115
+
116
+ make_log_dir
117
+
118
+ mount --bind $RAM_LOG / $HDD_LOG /
117
119
mount --make-private $HDD_LOG /
118
120
wait_for $HDD_LOG
119
121
0 commit comments