Docker bash-Skript Modul neustarten

Hallo zusammen,

ich führe nach einem IP-Symcon (Docker Container Update) immer ein bash Skript aus, um gewisse Pakete im Docker Container zu installieren (vim, less, curl, speedtest, usw.). Ist es möglich in so einem Bash-Skript beispielsweise ein Modul (Speedtest) kurz zu deaktivieren und aktivieren? Oder evtl. den ganzen Container neustarten?

Grüße
weazel

Und ich dachte, ich kenne schon alles… Was passiert da bei Dir?

Verstanden hab ich nur, dass Du beim Update der Symcon HA den gesamten Docker-Container austauschst.

Da ich nur Schuhe von Docker habe, verstehe ich nicht wo Dein Bash-Script läuft welches die Nachinstallation besorgt: Im Container oder ausserhalb welche dann irgendwas im Container macht?

Klär mich doch bitte mal auf weil ich mit Docker-Containern bislang nur aus der Ferne zu tun hatte.

Bernd

Du könntest über die JSONRPC Api die entsprechenden IPS Funktionen aus dem Bash Script aufrufen, eg. IPS_SetProperty und IPS_ApplyChanges. Wie Du die JSON Api aufrufst, kannst Du Dir aussuchen, mit PHP, Perl, Python, javascript, curl …

Ahhh, dank Dir. Funktioniert einwandfrei :slight_smile:

#!/bin/bash
# update and install other tools
apt update && apt upgrade -y && apt install -y gnupg1 apt-transport-https dirmngr vim curl ssh htop less
# install speedtest
curl -s https://packagecloud.io/install/repositories/ookla/speedtest-cli/script.deb.sh | bash
apt install -y speedtest
# start speedtest once
speedtest --accept-license --accept-gdpr
# reload speedtest module
curl -i -X POST -H "Content-Type: application/json" -d "{\"jsonrpc\": \"2.0\", \"id\": \"0\", \"method\": \"IPS_SetProperty\", \"params\": [47784, \"module_disable\", true]}" http://localhost:3777/api/
curl -i -X POST -H "Content-Type: application/json" -d "{\"jsonrpc\": \"2.0\", \"id\": \"0\", \"method\": \"IPS_ApplyChanges\", \"params\": [47784]}" http://localhost:3777/api/
curl -i -X POST -H "Content-Type: application/json" -d "{\"jsonrpc\": \"2.0\", \"id\": \"0\", \"method\": \"IPS_SetProperty\", \"params\": [47784, \"module_disable\", false]}" http://localhost:3777/api/
curl -i -X POST -H "Content-Type: application/json" -d "{\"jsonrpc\": \"2.0\", \"id\": \"0\", \"method\": \"IPS_ApplyChanges\", \"params\": [47784]}" http://localhost:3777/api/