Skip to content

Commit e3466d6

Browse files
authored
Add files via upload
1 parent d83ce20 commit e3466d6

File tree

7 files changed

+195
-200
lines changed

7 files changed

+195
-200
lines changed

99-conkys.rules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
ACTION=="remove", ENV{DEVNAME}=="/dev/sd?", RUN+="/usr/local/sbin/conkys_end.sh %k"
2+
ACTION=="add", KERNEL=="sd?", TAG+="systemd", ENV{SYSTEMD_WANTS}="conkys@%k.service"
3+
# Maybe line below work on systems without systemd
4+
#ACTION=="add", KERNEL=="sd?", RUN+="/usr/local/sbin/conkys_start.sh %k"

conkys.conf.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#! /usr/bin/env bash
2+
3+
# ###################################################################
4+
# ###################################################################
5+
# ******* Default settings **********
6+
7+
# Loop delay
8+
LOOP_DELAY=10
9+
10+
# Time (seconds) to switch to standby
11+
SPAT_ZA=600
12+
13+
# Log file. If no need logs comments line below
14+
LOG=/var/log/conkys
15+
16+
17+
################################################################################
18+
# ------------------------------------------------------------------------------
19+
# Do not change!
20+
# ******************************************************************************
21+
22+
# Create log
23+
[ $LOG ] || LOG=/dev/null
24+
25+
# Directory in RAM/SWAP
26+
OPERATIVNI_DIR=
27+
28+
# Config directory
29+
USER_DIR=
30+
31+
konfigurak=

[email protected]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
[Unit]
77

8-
Description=Spouštění skriptu na čtení teplot z disku %i
8+
Description=Start temperatur reader for disc %i
99

1010
[Service]
1111

conkys_data.conf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Privat database of disks connected to this PC
2+
# Lines begin with char # (hash) are ignored
3+
# Delimiter is char | (pipe)
4+
# Form line must be:
5+
# -----------------------------------------------------------------------
6+
# Ignoring HD | TYPE HD | serial number | HD timeout | Loop delay | treshold | arguments
7+
# -----------------------------------------------------------------------
8+
# Where
9+
# *Ignorig HD-> if value 1 HD is ignored
10+
# *TYPE HD -> TYPE from smartctl
11+
# *serial number -> from smartctl
12+
# *HD timeout -> After how many seconds HD has to switch to standby mode
13+
# *Loop delay -> how often has to script run (in sec)
14+
# *threshold -> how many reads are needed by smartctl to read temperature
15+
# *arguments -> we make HD better thanks to smartctl arguments
16+
17+
1|sat|WD-WXK1AC668T4T|600|10|12|-o off -s apm,128
18+
|sat|120322PBN406P7KBZDSE|600|10|9|

conkys_end.sh

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
#! /usr/bin/env bash
22

3-
# skript na ukončení procesu
4-
# Bude spouštěn pomocí `udev` při odpojení disku
5-
# Při manuálním použití je nutno volat se sudo:
6-
# sudo ukonci.sh disk
7-
# kde `disk` je disk který byl odpojen
8-
3+
# This script make "game over"
94
source
105

11-
# Načte pid ovládacího procesu z jeho adresáře
12-
# PID=`cat /dev/shm/conkys/$1/PID`
6+
# read PID process to be killed
137
PID=`cat $OPERATIVNI_DIR/$1/PID`
148

15-
# a zašle mu signál SIGTERM
16-
kill $PID && echo "$(date +'%F %T') $1 proces byl ukončen" >> "$LOG" || echo "$(date +'%F %T') nelze zabít $1 s PID $PID" >> "$LOG"
9+
[ "$PID" = "" ] && echo "$(date +'%F %T') $1 do not exist" >> "$LOG" && exit 0
10+
11+
# send signal SIGTERM
12+
kill $PID && echo "$(date +'%F %T') $1 process has been ended" >> "$LOG" || echo "$(date +'%F %T') unablle kill $1 with PID $PID" >> "$LOG"

0 commit comments

Comments
 (0)