Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
scripts-perso
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Daniel Stan
scripts-perso
Commits
3cdf1e44
Commit
3cdf1e44
authored
Feb 17, 2018
by
Daniel Stan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prise en compte du lotus sur la remote
parent
bf1d12bb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
2 deletions
+17
-2
utils/toggle.sh
utils/toggle.sh
+17
-2
No files found.
utils/toggle.sh
View file @
3cdf1e44
...
...
@@ -3,16 +3,31 @@
SEND
=
/home/dstan/433Utils/RPi_utils/codesend
ENCODE
=
/home/dstan/scripts-perso/utils/build_relay.py
LOTUS
=
/home/dstan/scripts-perso/bin/lotus
TMPDIR
=
/tmp/relaystates
mkdir
-p
$TMPDIR
relay
=
$(
echo
"
$1
"
|
sed
"s/[^0-9]//g"
)
onfile
=
$TMPDIR
/
$relay
-on
send
()
{
# $1 = numéro de relai, $2 = on or off
if
[
"
$1
"
-eq
5
]
;
then
if
[
"
$2
"
=
"on"
]
;
then
$LOTUS
f
else
$LOTUS
o
fi
else
$SEND
$(
$ENCODE
"
$2
"
4
"
$1
"
)
fi
}
if
[
-f
$onfile
]
;
then
$SEND
$(
$ENCODE
off 4
$relay
)
send
$relay
off
rm
$onfile
else
$SEND
$(
$ENCODE
on 4
$relay
)
send
$relay
on
touch
$onfile
fi
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