-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathinstall.sh
executable file
·53 lines (38 loc) · 1.28 KB
/
install.sh
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
#!/bin/bash
BINDIR=/usr/local/bin
INITDIR=/etc/init.d
UDEVDIR=/etc/udev/rules.d
if [ ! -f "mustang_midi" ]; then
echo "Must build mustang_midi first!"
exit 1
fi
if ! `grep -q mustang-user /etc/passwd`; then
echo "Create non-privileged user for MIDI bridge"
useradd -M -s /bin/false -G plugdev,audio mustang-user
fi
echo "Copy program and support scripts to $BINDIR"
cp -f mustang_bridge_start $BINDIR
chmod 0755 $BINDIR/mustang_bridge_start
chown root:root $BINDIR/mustang_bridge_start
cp -f mustang_bridge_stop $BINDIR
chmod 0755 $BINDIR/mustang_bridge_stop
chown root:root $BINDIR/mustang_bridge_stop
cp -f mustang_midi $BINDIR
chmod 0755 $BINDIR/mustang_midi
chown root:root $BINDIR/mustang_midi
echo "Copy init script to $INITDIR and register"
cp -f mustang_bridge $INITDIR
chmod 0755 $INITDIR/mustang_bridge
chown root:root $INITDIR/mustang_bridge
update-rc.d mustang_bridge defaults
# Run it right now to create the /var/run directory
$INITDIR/mustang_bridge start
echo "Copy udev rules to $UDEVDIR and refresh system"
cp -f 50-mustang.rules $UDEVDIR
chmod 0644 $UDEVDIR/50-mustang.rules
chown root:root $UDEVDIR/50-mustang.rules
cp -f 60-midi.rules $UDEVDIR
chmod 0644 $UDEVDIR/60-midi.rules
chown root:root $UDEVDIR/60-midi.rules
udevadm control --reload
echo "Done!"