-
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix[close #320]: Newly created users are required to create a new user
- Loading branch information
1 parent
5d8a17b
commit 970f53c
Showing
6 changed files
with
79 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ | |
import os | ||
import shutil | ||
import subprocess | ||
import getpass | ||
import logging | ||
|
||
|
||
|
@@ -54,11 +55,14 @@ def get_setup_commands(log_path, pre_run, post_run, commands): | |
command = command.replace("!noRoot", "") | ||
command = command.replace('"', '\\"') | ||
command = command.replace("'", "\\'") | ||
command = "systemd-run --user --machine=\"[email protected]\" -P -q /usr/bin/bash -c \"%s\"" % command | ||
command = ( | ||
'systemd-run --user --machine="[email protected]" -P -q /usr/bin/bash -c "%s"' | ||
% command | ||
) | ||
|
||
next_boot.append(command) | ||
|
||
subprocess.run([pkexec_bin, "/usr/bin/vanilla-first-setup-prepare-files"]) | ||
subprocess.run([pkexec_bin, "/usr/bin/vanilla-first-setup-prepare-files", getpass.getuser()]) # type: ignore | ||
|
||
# generating the commannds and writing them to a file to run them all at once | ||
with open(commands_script_path, "w") as f: | ||
|
@@ -113,7 +117,10 @@ def get_setup_commands(log_path, pre_run, post_run, commands): | |
command = command.replace("!noRoot", "") | ||
command = command.replace('"', '\\"') | ||
command = command.replace("'", "\\'") | ||
command = "systemd-run --user --machine=\"[email protected]\" -P -q /usr/bin/bash -c \"%s\"" % command | ||
command = ( | ||
'systemd-run --user --machine="[email protected]" -P -q /usr/bin/bash -c "%s"' | ||
% command | ||
) | ||
|
||
# outRun bang is used to run a command outside of the main | ||
# shell script. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
#!/bin/bash | ||
_user=$1 | ||
|
||
touch /etc/org.vanillaos.FirstSetup.commands | ||
touch /etc/org.vanillaos.FirstSetup.nextBoot | ||
|
||
chmod +wx /etc/org.vanillaos.FirstSetup.commands | ||
chown vanilla:vanilla /etc/org.vanillaos.FirstSetup.commands | ||
chown $_user:$_user /etc/org.vanillaos.FirstSetup.commands | ||
chmod +wx /etc/org.vanillaos.FirstSetup.nextBoot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters