-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall.sh
70 lines (55 loc) · 2.05 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/bash
#########################################
## ENVIRONMENTAL CONFIG ##
#########################################
# Configure user nobody to match unRAID's settings
export DEBIAN_FRONTEND="noninteractive"
usermod -u 99 nobody
usermod -g 100 nobody
usermod -d /home nobody
chown -R nobody:users /home
# Disable SSH, Syslog and Cron
rm -rf /etc/service/sshd /etc/service/cron /etc/service/syslog-ng /etc/my_init.d/00_regen_ssh_host_keys.sh
#########################################
## REPOSITORIES AND DEPENDENCIES ##
#########################################
# Repositories
add-apt-repository "deb http://us.archive.ubuntu.com/ubuntu/ trusty universe multiverse"
add-apt-repository "deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates universe multiverse"
#curl -skL -o /etc/apt/sources.list http://tinyurl.com/lm2vf9a
# Install Dependencies
apt-get update -qq
apt-get install -qy lame faad flac sox
#########################################
## FILES, SERVICES AND CONFIGURATION ##
#########################################
# LMS
mkdir -p /etc/service/logitechmediaserver
cat <<'EOT' > /etc/service/logitechmediaserver/run
#!/bin/bash
chown -R nobody:users /config
squeezeboxserver --user nobody --prefsdir /config/prefs --logdir /config/logs --cachedir /config/cache
EOT
chmod -R +x /etc/service/ /etc/my_init.d/
#########################################
## INSTALLATION ##
#########################################
# Install LMS
OUT=$(curl -skL "http://downloads.slimdevices.com/nightly/index.php?ver=7.9")
# Try to catch the link or die
REGEX=".*href=\".(.*)amd64.deb\""
if [[ ${OUT} =~ ${REGEX} ]]; then
URL="http://downloads.slimdevices.com/nightly${BASH_REMATCH[1]}amd64.deb"
else
exit 1
fi
curl -skL -o /tmp/lms.deb $URL
dpkg -i /tmp/lms.deb
rm /tmp/lms.deb
/etc/init.d/avahi-daemon restart
#########################################
## CLEANUP ##
#########################################
# Clean APT install files
apt-get clean -y
rm -rf /var/lib/apt/lists/* /var/cache/* /var/tmp/*