mirror of
https://github.com/arcan1s/netctl-gui.git
synced 2025-04-24 15:37:23 +00:00
fix profile reading
This commit is contained in:
parent
f7e39c7834
commit
341a19a955
@ -64,7 +64,6 @@ Additional information
|
||||
TODO (wish list)
|
||||
----------------
|
||||
|
||||
* test profile reading
|
||||
* man pages
|
||||
|
||||
Links
|
||||
|
@ -132,10 +132,12 @@ QMap<QString, QString> NetctlProfile::getSettingsFromProfile(const QString profi
|
||||
keys.append(output[i].split(QChar('='))[0]);
|
||||
for (int i=0; i<keys.count(); i++){
|
||||
cmd = QString("env -i bash -c \"source ") + profileUrl +
|
||||
QString(" && printf -- '%s\n' \"${") + keys[i] + ("[@]}\"");
|
||||
QString("; for i in ${!") + keys[i] + QString("[@]}; do echo ${") +
|
||||
keys[i] + QString("[$i]}; done\"");
|
||||
shell.start(cmd);
|
||||
shell.waitForFinished(-1);
|
||||
settings[keys[i]] = shell.readAllStandardOutput().trimmed();
|
||||
if (debug) qDebug() << "[NetctlProfile]" << "[getSettingsFromProfile]" << ":" << keys[i] << "=" << settings[keys[i]];
|
||||
}
|
||||
|
||||
return settings;
|
||||
|
Loading…
Reference in New Issue
Block a user