Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 002698f

Browse files
committed
component for custom power trigger
1 parent aba3b49 commit 002698f

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

‎include/core/power/deploy.conf‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Linux Deploy Component
2+
# (c) Anton Skshidlevsky <meefik@gmail.com>, GPLv3
3+
4+
NAME="power"
5+
DESC="Power mangaement"

‎include/core/power/deploy.sh‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/sh
2+
# Linux Deploy Component
3+
# (c) Anton Skshidlevsky <meefik@gmail.com>, GPLv3
4+
5+
do_start()
6+
{
7+
if [ -n "${POWER_TRIGGER}" ]; then
8+
msg ":: Starting ${COMPONENT} ... "
9+
chroot_exec -u root "${POWER_TRIGGER} start"
10+
fi
11+
return 0
12+
}
13+
14+
do_stop()
15+
{
16+
if [ -n "${POWER_TRIGGER}" ]; then
17+
msg ":: Stopping ${COMPONENT} ... "
18+
chroot_exec -u root "${POWER_TRIGGER} stop"
19+
fi
20+
return 0
21+
}
22+
23+
do_help()
24+
{
25+
cat <<EOF
26+
--power-trigger="${POWER_TRIGGER}"
27+
Path to a script inside the container to process power changes.
28+
29+
EOF
30+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /