-
Notifications
You must be signed in to change notification settings - Fork 11
/
runeaudio.rune_shutdown
59 lines (56 loc) · 1.58 KB
/
runeaudio.rune_shutdown
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
#
# Copyright (C) 2013-2014 RuneAudio Team
# http://www.runeaudio.com
#
# RuneUI
# copyright (C) 2013-2014 – Andrea Coiutti (aka ACX) & Simone De Gregori (aka Orion)
#
# RuneOS
# copyright (C) 2013-2014 – Simone De Gregori (aka Orion) & Carmelo San Giovanni (aka Um3ggh1U)
#
# RuneAudio website and logo
# copyright (C) 2013-2014 – ACX webdesign (Andrea Coiutti)
#
# This Program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# This Program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with RuneAudio; see the file COPYING. If not, see
# <http://www.gnu.org/licenses/gpl-3.0.txt>.
#
# file: command/rune_shutdown
# version: 1.3
# coder: Simone De Gregori
# mod by hondagx35
if [[ $1 == "poweroff" ]]
then
echo "power off RuneAudio"
gpio mode 7 out
gpio write 7 1
sleep 1
echo "Setting pin GPIO7 Low"
gpio write 7 0
else
echo "reboot RuneAudio"
# Reboot blink will stop after Boot OK return
echo "setting pin GPIO 4 High"
gpio -g mode 4 out
gpio -g write 4 1
fi
echo "Stop MPD and unmount shares..."
mpc stop
systemctl stop nginx
sleep 1
systemctl stop mpd
systemctl stop spopd
sleep 1
umount -aft nfs
umount -aft cifs