-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implementation of daemon option in agent #22
Conversation
Signed-off-by: Alberto Morgante Medina <alknopfler@users.noreply.github.com>
Signed-off-by: Alberto Morgante Medina <alknopfler@users.noreply.github.com>
Signed-off-by: Alberto Morgante Medina <alknopfler@users.noreply.github.com>
Signed-off-by: Alberto Morgante Medina <alknopfler@users.noreply.github.com>
Signed-off-by: Alberto Morgante Medina <alknopfler@users.noreply.github.com>
Signed-off-by: Alberto Morgante Medina <alknopfler@users.noreply.github.com>
Signed-off-by: Alberto Morgante Medina <alknopfler@users.noreply.github.com>
func (a *Agent) prepareEnvDaemon() error { | ||
log.Println("[INFO] Get the Bootstrap URL from DHCP client") | ||
|
||
if _, err := os.Stat(DHCLIENT_LEASE_FILE); err == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to do this in a loop, because it takes time to get a lease from DHCP server...
) | ||
|
||
const ( | ||
DHCLIENT_LEASE_FILE = "/var/lib/dhclient/dhclient.leases" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we might do it a separate file so we can have logic for both: DHCP, mDNS and SLAAC
wdyt ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WDYM?
instead of the loop looking this:
if _, err := os.Stat(DHCLIENT_LEASE_FILE); err == nil {
line := linesInFileContains(DHCLIENT_LEASE_FILE, SZTP_REDIRECT_URL)
a.BootstrapURL = extractURLfromLine(line, `(?m)[^"]*`)
log.Println(a)
have a function to look 3 sources (dhclient.leases, slaac and mdns) to know where's the change and continue with this change?
Signed-off-by: Alberto Morgante Medina <alknopfler@users.noreply.github.com>
Signed-off-by: Alberto Morgante Medina <alknopfler@users.noreply.github.com>
Contains: