aboutsummaryrefslogtreecommitdiff
path: root/mpd-music/music.init
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2017-10-20 20:58:50 +0200
committerKarel Kočí <cynerd@email.cz>2017-10-20 20:58:50 +0200
commite8f65f635a15a0d0aa29bfb8308f4cb812470cac (patch)
tree865e7c7e5b2e6d9ba6c7e23c53fea621502ca803 /mpd-music/music.init
parentc5f307a330c141c955d4bc99f4675d816b28e223 (diff)
downloadmulticonfig-e8f65f635a15a0d0aa29bfb8308f4cb812470cac.tar.gz
multiconfig-e8f65f635a15a0d0aa29bfb8308f4cb812470cac.tar.bz2
multiconfig-e8f65f635a15a0d0aa29bfb8308f4cb812470cac.zip
Add mpd-music
Diffstat (limited to 'mpd-music/music.init')
-rwxr-xr-xmpd-music/music.init34
1 files changed, 34 insertions, 0 deletions
diff --git a/mpd-music/music.init b/mpd-music/music.init
new file mode 100755
index 0000000..4a5c654
--- /dev/null
+++ b/mpd-music/music.init
@@ -0,0 +1,34 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ use logger
+}
+
+mounted() {
+ mount | grep -q ' /music '
+}
+
+status() {
+ mounted
+}
+
+start() {
+ if mounted; then
+ einfo "Already mounted"
+ return
+ fi
+
+ mkdir -p /music
+ sshfs -o rw,allow_other root@10.8.2.1:/data/music /music
+}
+
+stop() {
+ if ! mounted; then
+ ewarn "Already not mounted"
+ return
+ fi
+
+ fusermount -u /music
+}