Fixed handling of known_networks
This commit is contained in:
parent
b554cfebe0
commit
d51538aac3
2 changed files with 12 additions and 3 deletions
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
import uuid
|
||||
|
||||
KNOWN_NETWORKS = '/root/known_networks'
|
||||
|
|
@ -34,13 +35,21 @@ method=auto
|
|||
'''
|
||||
|
||||
def get_user_name():
|
||||
"""Get real user name, returns str."""
|
||||
"""Get user name, returns str."""
|
||||
user = None
|
||||
|
||||
# Get running user
|
||||
if 'SUDO_USER' in os.environ:
|
||||
user = os.environ.get('SUDO_USER')
|
||||
else:
|
||||
user = os.environ.get('USER')
|
||||
|
||||
# Check if user manually specified
|
||||
for a in sys.argv:
|
||||
a = a.strip().lower()
|
||||
if a.startswith('--user='):
|
||||
user = a.replace('--user=', '')
|
||||
|
||||
return user
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
|||
|
|
@ -283,8 +283,8 @@ function update_live_env() {
|
|||
fi
|
||||
|
||||
# WiFi
|
||||
cp "$ROOT_DIR/.linux_items/known_networks" "/root/known_networks"
|
||||
echo "add-known-networks" >> "$LIVE_DIR/airootfs/root/customize_airootfs.sh"
|
||||
cp "$ROOT_DIR/.linux_items/known_networks" "$LIVE_DIR/airootfs/root/known_networks"
|
||||
echo "add-known-networks --user=$username" >> "$LIVE_DIR/airootfs/root/customize_airootfs.sh"
|
||||
}
|
||||
|
||||
function update_repo() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue