diff system/smartmontools/smartd @ 1026:3dfef64b81c1

vanilla: update all init scripts
author David Demelier <markand@malikania.fr>
date Thu, 29 Aug 2019 20:34:00 +0200
parents 657ee4987f4d
children
line wrap: on
line diff
--- a/system/smartmontools/smartd	Thu Aug 29 20:33:00 2019 +0200
+++ b/system/smartmontools/smartd	Thu Aug 29 20:34:00 2019 +0200
@@ -27,14 +27,18 @@
 
 smartd_start()
 {
-	echo "Starting smartd: $SMARTD_CMD $SMARTD_ARGS"
-	$SMARTD_CMD $SMARTD_ARGS -p $SMARTD_PID
+	if [ -s $SMARTD_PID ]; then
+		echo "smartd is already running with pid: $(cat $SMARTD_PID)"
+	else
+		echo "Starting smartd: $SMARTD_CMD $SMARTD_ARGS"
+		$SMARTD_CMD $SMARTD_ARGS -p $SMARTD_PID
+	fi
 }
 
 smartd_status()
 {
 	if [ -s $SMARTD_PID ]; then
-		echo "smartd is running with pid: `cat $SMARTD_PID`"
+		echo "smartd is running with pid: $(cat $SMARTD_PID)"
 	else
 		echo "smartd is not running"
 	fi