Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Config
Commits
7d8edf13
Commit
7d8edf13
authored
Feb 09, 2015
by
Igor Pecovnik
Browse files
Added some buffer for PIR sensor, bugfix
parent
7c7ebf27
Changes
3
Show whitespace changes
Inline
Side-by-side
functions.sh
View file @
7d8edf13
...
@@ -91,7 +91,7 @@ debconf-apt-progress -- apt-get -y install rpimonitor
...
@@ -91,7 +91,7 @@ debconf-apt-progress -- apt-get -y install rpimonitor
service rpimonitor stop
service rpimonitor stop
# add my own configuration which is not default
# add my own configuration which is not default
cd
/etc/rpimonitor
cd
/etc/rpimonitor
wget https://github.com/igorpecovnik/Debian-micro-home-server/blob/next/src/rpimonitor-myconfig.tgz?raw
=
true
-O
- |
tar
-xz
wget https://github.com/igorpecovnik/Debian-micro-home-server/blob/next/src/rpimonitor-myconfig.tgz?raw
=
true
-O
- |
tar
-x
h
z
cd
/usr/local/bin
cd
/usr/local/bin
wget https://github.com/igorpecovnik/Debian-micro-home-server/blob/next/src/temp-pir-daemon.sh
wget https://github.com/igorpecovnik/Debian-micro-home-server/blob/next/src/temp-pir-daemon.sh
chmod
+x /usr/local/bin/temp-pir-daemon.sh
chmod
+x /usr/local/bin/temp-pir-daemon.sh
...
@@ -100,8 +100,8 @@ cat >> /etc/rc.local <<"EOF"
...
@@ -100,8 +100,8 @@ cat >> /etc/rc.local <<"EOF"
nohup /usr/local/bin/temp-pir-daemon.sh &
nohup /usr/local/bin/temp-pir-daemon.sh &
exit 0
exit 0
EOF
EOF
ln
-sf
/etc/rpimonitor/template/bananian.conf /etc/rpimonitor/data.conf
rm
-rf
/var/lib/rpimonitor/stat
rm
-rf
/var/lib/rpimonitor/stat
mkdir
-p
/var/log/rpimonitor
service rpimonitor start
service rpimonitor start
/usr/share/rpimonitor/scripts/updatePackagesStatus.pl
/usr/share/rpimonitor/scripts/updatePackagesStatus.pl
}
}
...
...
src/rpimonitor-myconfig.tgz
View file @
7d8edf13
No preview for this file type
src/temp-pir-daemon.sh
View file @
7d8edf13
...
@@ -41,6 +41,13 @@ Main() {
...
@@ -41,6 +41,13 @@ Main() {
echo
-n
${
DiskTemp
}
>
/run/hdd-temp
echo
-n
${
DiskTemp
}
>
/run/hdd-temp
fi
fi
# PIR sensor
if
[
!
-f
/run/pir-temp
]
;
then
echo
0
>
/run/pir-temp
;
fi
if
[
"
$(
cat
/sys/class/gpio/gpio22/value
)
"
==
"1"
]
;
then
echo
1
>
/run/pir-temp
;
fi
if
[
`
stat
--format
=
%Y /run/pir-temp
`
-le
$((
`
date
+%s
`
-
600
))
]
;
then
cat
/sys/class/gpio/gpio22/value
>
/run/pir-temp
fi
# sleep 5 secs
# sleep 5 secs
sleep
5
sleep
5
done
done
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment