generated from chourmovs/moode_tinkerboard
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmoode_docker.sh
142 lines (122 loc) · 4.24 KB
/
moode_docker.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
#!/bin/bash
printf "\ec"
echo ""
echo "****************************************************"
echo "* Moode on docker multiarch install script *"
echo "* By chourmovs v 1.1 *"
echo "****************************************************"
echo ""
echo ""
echo ""
echo ""
echo "****************************************************"
echo "* Activate Podman *"
echo "****************************************************"
echo ""
podman system migrate
podman machine init
podman machine start
echo "************************************************************************"
echo "* create container with systemd in priviledged mode and start it *"
echo "************************************************************************"
echo ""
echo ""
podman volume create moode
podman run -ti --systemd=always --name debian-moode --network=host --entrypoint=/usr/bin/qemu-arm-static --security-opt seccomp:unconfined --privileged navikey/raspbian-bullseye -execve -0 /sbin/init /sbin/init
# sudo podman container start debian-moode
podman generate systemd --new --files -n debian-moode
sudo cp /home/$USER/container-debian-moode.service /etc/systemd/system
systemctl daemon-reload
systemctl start container-debian-moode
sleep 2
# podman exec -ti debian-moode /bin/bash -c "ip addr show"
sleep 2
echo ""
echo "*********************************************"
echo "* install vital dependecies *"
echo "*********************************************"
echo ""
sleep 2
podman exec -ti debian-moode /bin/bash -c "apt-get update -y ; sleep 3 ; apt-get upgrade -y"
podman exec -ti debian-moode /bin/bash -c "apt-get install -y curl sudo libxaw7 ssh libsndfile1 libsndfile1-dev cifs-utils"
podman exec -ti debian-moode /bin/bash -c "apt --fix-broken install -y"
echo ""
echo ""
# read -p "Press any key to continue... " -n1 -s
echo ""
echo ""
echo "Will change ssh port to 2222 to fix openssh"
echo ""
echo ""
sleep 1
podman exec -ti debian-moode /bin/bash -c "sudo sed -i 's/#Port 22/Port 2222/g' /etc/ssh/sshd_config;"
podman exec -ti debian-moode /bin/bash -c "systemctl restart sshd"
echo ""
echo "*********************************************"
echo "* install moode player *"
echo "*********************************************"
echo ""
sleep 1
podman exec -ti debian-moode /bin/bash -c "curl -1sLf 'https://dl.cloudsmith.io/public/moodeaudio/m8y/setup.deb.sh' | sudo -E distro=raspbian codename=bullseye arch=armv7hf bash -"
podman exec -ti debian-moode /bin/bash -c "apt-get update -y"
podman exec -ti debian-moode /bin/bash -c "apt-get install udisks nginx triggerhappy samba dnsmasq -y"
echo ""
echo ""
#read -p "Press any key to continue... " -n1 -s
podman exec -ti debian-moode /bin/bash -c "apt-get install moode-player -y --fix-missing"
echo ""
echo ""
echo ""
echo "In general this long install return error, next move will try to fix this"
echo ""
echo ""
echo ""
podman exec -ti debian-moode /bin/bash -c "apt --fix-broken install -y"
sleep 1
echo ""
echo ""
echo ""
podman exec -ti debian-moode /bin/bash -c "apt-get install moode-player -y --fix-missing"
sleep 1
echo ""
echo ""
echo ""
podman exec -ti debian-moode /bin/bash -c "apt upgrade -y"
#sleep 1
echo ""
echo ""
echo ""
echo ""
echo ""
echo ""
echo "****************************************"
echo "* restart moode player (host side) *"
echo "****************************************"
systemctl stop container-debian-moode
systemctl start container-debian-moode
echo ""
echo ""
echo "***************************************"
echo "* configure nginx (container side) *"
echo "***************************************"
echo ""
echo "Will change moode http port to 8008 to avoid conflict with volumio front"
echo ""
echo ""
sleep 1
podman exec -ti debian-moode /bin/bash -c "sudo sed -i 's/80 /8008 /g' /etc/nginx/sites-available/moode-http.conf"
podman exec -ti debian-moode /bin/bash -c "systemctl start my-service@* --all"
podman exec -ti debian-moode /bin/bash -c "systemctl restart nginx"
echo ""
echo "****************************"
echo "* Access Moode web UI *"
echo "****************************"
echo ""
echo ""
echo "Your device will now restart"
echo ""
echo ""
echo "CTRL+CLIC on http://moode:8008"
echo ""
echo "Enjoy"
# sudo reboot