Skip to content

Commit 426c563

Browse files
author
Oliver Cervera
authored
Remove clean_desc function
Moved date to the proper authorized sync message Removed clean_desc function, was only required for containers
1 parent ac9c89b commit 426c563

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

snapraid-aio-script.sh

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
######################
99
# CONFIG VARIABLES #
1010
######################
11-
SNAPSCRIPTVERSION="2.7.0.1-DEV4"
11+
SNAPSCRIPTVERSION="2.7.0.1-DEV6"
1212

1313
# find the current path
1414
CURRENT_DIR="$(dirname "${0}")"
@@ -129,7 +129,7 @@ function main(){
129129

130130
# Now run sync if conditions are met
131131
if [ $DO_SYNC -eq 1 ]; then
132-
echo "SYNC is authorized."
132+
echo "SYNC is authorized. [`date`]"
133133
echo "###SnapRAID SYNC [`date`]"
134134
mklog "INFO: SnapRAID SYNC Job started"
135135
if [ $PREHASH -eq 1 ]; then
@@ -263,8 +263,6 @@ function main(){
263263
fi
264264
fi
265265

266-
#clean_desc
267-
268266
exit 0;
269267
}
270268

@@ -358,7 +356,7 @@ function chk_updated(){
358356
function chk_sync_warn(){
359357
if [ $SYNC_WARN_THRESHOLD -gt -1 ]; then
360358
if [ $SYNC_WARN_THRESHOLD -eq 0 ]; then
361-
echo "Forced sync is enabled. [`date`]"
359+
echo "Forced sync is enabled."
362360
mklog "INFO: Forced sync is enabled."
363361
else
364362
echo "Sync after threshold warning(s) is enabled."
@@ -374,7 +372,7 @@ function chk_sync_warn(){
374372
DO_SYNC=1
375373
else
376374
# if there is at least one warn count, output a message and force a sync job. Do not need to remove warning marker here as it is automatically removed when the sync job is run by this script
377-
echo "Number of threshold warning(s) ($SYNC_WARN_COUNT) has reached/exceeded threshold ($SYNC_WARN_THRESHOLD). Forcing a SYNC job to run. [`date`]"
375+
echo "Number of threshold warning(s) ($SYNC_WARN_COUNT) has reached/exceeded threshold ($SYNC_WARN_THRESHOLD). Forcing a SYNC job to run."
378376
mklog "INFO: Number of threshold warning(s) ($SYNC_WARN_COUNT) has reached/exceeded threshold ($SYNC_WARN_THRESHOLD). Forcing a SYNC job to run."
379377
DO_SYNC=1
380378
fi
@@ -426,14 +424,6 @@ function service_array_setup() {
426424
fi
427425
}
428426

429-
function clean_desc(){
430-
# Cleanup file descriptors
431-
exec >&{out} 2>&{err}
432-
433-
# If interactive shell restore output
434-
[[ $- == *i* ]] && exec &>/dev/tty
435-
}
436-
437427
function prepare_mail() {
438428
if [ $CHK_FAIL -eq 1 ]; then
439429
if [ $DEL_COUNT -ge $DEL_THRESHOLD -a $DO_SYNC -eq 0 ]; then

0 commit comments

Comments
 (0)