mirror of
https://github.com/azlux/log2ram.git
synced 2023-10-10 13:37:24 +02:00
fix indent
This commit is contained in:
parent
0e09169876
commit
6d5b84ba75
28
log2ram
28
log2ram
@ -15,10 +15,10 @@ remountRW() {
|
|||||||
RESU=$?
|
RESU=$?
|
||||||
INITIAL_STATUS=ro
|
INITIAL_STATUS=ro
|
||||||
if [ "$RESU" != "0" ] ; then
|
if [ "$RESU" != "0" ] ; then
|
||||||
mount -o remount,rw ${HDD_LOG}
|
mount -o remount,rw ${HDD_LOG}
|
||||||
else
|
else
|
||||||
INITIAL_STATUS=rw
|
INITIAL_STATUS=rw
|
||||||
rm $HDD_LOG/$$ 2>/dev/null
|
rm $HDD_LOG/$$ 2>/dev/null
|
||||||
fi
|
fi
|
||||||
# for return
|
# for return
|
||||||
echo $INITIAL_STATUS
|
echo $INITIAL_STATUS
|
||||||
@ -91,14 +91,14 @@ make_log_dir () {
|
|||||||
# if create mount failed, try to remount in rw the parent directory
|
# if create mount failed, try to remount in rw the parent directory
|
||||||
# and restore original status
|
# and restore original status
|
||||||
if [ ! -d $HDD_LOG/ ] ; then
|
if [ ! -d $HDD_LOG/ ] ; then
|
||||||
mkdir $HDD_LOG/ 2>/dev/null /dev/null
|
mkdir $HDD_LOG/ 2>/dev/null /dev/null
|
||||||
RESU=$?
|
RESU=$?
|
||||||
if [ "$RESU" -ne "0" ] ; then
|
if [ "$RESU" -ne "0" ] ; then
|
||||||
MOUNT_POINT=$(findmnt -T ` dirname $HDD_LOG/ ` -n --raw | cut -d ' ' -f 1 )
|
MOUNT_POINT=$(findmnt -T ` dirname $HDD_LOG/ ` -n --raw | cut -d ' ' -f 1 )
|
||||||
mount -o remount,rw ${MOUNT_POINT}
|
mount -o remount,rw ${MOUNT_POINT}
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
mkdir $HDD_LOG/
|
mkdir $HDD_LOG/
|
||||||
mount -o remount,ro ${MOUNT_POINT}
|
mount -o remount,ro ${MOUNT_POINT}
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@ -112,8 +112,10 @@ case "$1" in
|
|||||||
RAM_LOG=$i
|
RAM_LOG=$i
|
||||||
HDD_LOG=$PATH_FIRST_PART/hdd.$PATH_LAST_PART
|
HDD_LOG=$PATH_FIRST_PART/hdd.$PATH_LAST_PART
|
||||||
LOG2RAM_LOG="${RAM_LOG}/${LOG_NAME}"
|
LOG2RAM_LOG="${RAM_LOG}/${LOG_NAME}"
|
||||||
make_log_dir
|
|
||||||
mount --bind $RAM_LOG/ $HDD_LOG/
|
make_log_dir
|
||||||
|
|
||||||
|
mount --bind $RAM_LOG/ $HDD_LOG/
|
||||||
mount --make-private $HDD_LOG/
|
mount --make-private $HDD_LOG/
|
||||||
wait_for $HDD_LOG
|
wait_for $HDD_LOG
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user