Update hostname.py

This commit is contained in:
qiaofeng1227 2023-08-26 18:24:53 +08:00 committed by GitHub
parent e0be8f29ee
commit 61e925ada5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,5 @@
from websoft9.appmanage.api.utils.log import myLogger
from api.utils.log import myLogger
from api.utils import shell_execute
shell_execute.execute_command_output_all("sed -i '/websoft9-appmanage/d' /etc/hosts")
shell_execute.execute_command_output_all("echo $(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' websoft9-appmanage) websoft9-appmanage >> /etc/hosts")
shell_execute.execute_command_output_all("echo $(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' websoft9-appmanage) websoft9-appmanage >> /etc/hosts")