This commit is contained in:
parent
440cec8944
commit
38eff8149d
4 changed files with 11 additions and 11 deletions
2
debian/postinst
vendored
2
debian/postinst
vendored
|
|
@ -223,7 +223,7 @@ if "HOWDY_NO_PROMPT" not in os.environ:
|
||||||
diag_out += "```"
|
diag_out += "```"
|
||||||
|
|
||||||
# Print it all as a clickable link to a new github issue
|
# Print it all as a clickable link to a new github issue
|
||||||
print("https://github.com/Boltgolt/howdy-reports/issues/new?title=Post-installation%20camera%20information&body=" + urllib.parse.quote_plus(diag_out) + "\n")
|
print("https://github.com/boltgolt/howdy-reports/issues/new?title=Post-installation%20camera%20information&body=" + urllib.parse.quote_plus(diag_out) + "\n")
|
||||||
|
|
||||||
# Let the user know what to do with the link
|
# Let the user know what to do with the link
|
||||||
print("Installation complete.")
|
print("Installation complete.")
|
||||||
|
|
|
||||||
10
src/cli.py
10
src/cli.py
|
|
@ -10,10 +10,13 @@ import argparse
|
||||||
import builtins
|
import builtins
|
||||||
|
|
||||||
# Try to get the original username (not "root") from shell
|
# Try to get the original username (not "root") from shell
|
||||||
user = subprocess.check_output("echo $(logname 2>/dev/null || echo $SUDO_USER)", shell=True).decode("ascii").strip()
|
try:
|
||||||
|
user = os.getlogin()
|
||||||
|
except:
|
||||||
|
user = os.environ.get("SUDO_USER")
|
||||||
|
|
||||||
# If that fails, try to get the direct user
|
# If that fails, try to get the direct user
|
||||||
if user == "root" or user == "":
|
if user == "root" or user == None:
|
||||||
env_user = getpass.getuser().strip()
|
env_user = getpass.getuser().strip()
|
||||||
|
|
||||||
# If even that fails, error out
|
# If even that fails, error out
|
||||||
|
|
@ -73,7 +76,8 @@ builtins.howdy_user = args.user
|
||||||
# Check if we have rootish rights
|
# Check if we have rootish rights
|
||||||
# This is this far down the file so running the command for help is always possible
|
# This is this far down the file so running the command for help is always possible
|
||||||
if os.getenv("SUDO_USER") is None:
|
if os.getenv("SUDO_USER") is None:
|
||||||
print("Please run this command with sudo")
|
print("Please run this command as root:\n")
|
||||||
|
print("\tsudo howdy " + " ".join(sys.argv[1:]))
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
# Beond this point the user can't change anymore, if we still have root as user we need to abort
|
# Beond this point the user can't change anymore, if we still have root as user we need to abort
|
||||||
|
|
|
||||||
|
|
@ -6,10 +6,7 @@ import time
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
# Let the user know what we're doing
|
# Let the user know what we're doing
|
||||||
print("Opening config.ini in gedit")
|
print("Opening config.ini in the default editor")
|
||||||
|
|
||||||
# Open gedit as a subprocess and fork it
|
# Open gedit as a subprocess and fork it
|
||||||
subprocess.Popen(["gedit", os.path.dirname(os.path.realpath(__file__)) + "/../config.ini"],
|
subprocess.call(["/etc/alternatives/editor", os.path.dirname(os.path.realpath(__file__)) + "/../config.ini"])
|
||||||
cwd="/",
|
|
||||||
stdout=subprocess.PIPE,
|
|
||||||
stderr=subprocess.STDOUT)
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
# Howdy config file
|
# Howdy config file
|
||||||
|
# Press CTRL + X to save in the nano editor
|
||||||
|
|
||||||
[core]
|
[core]
|
||||||
# Do not print anything when a face verification succeeds
|
# Do not print anything when a face verification succeeds
|
||||||
|
|
@ -46,5 +47,3 @@ dark_threshold = 50
|
||||||
[debug]
|
[debug]
|
||||||
# Show a short but detailed diagnostic report in console
|
# Show a short but detailed diagnostic report in console
|
||||||
end_report = false
|
end_report = false
|
||||||
|
|
||||||
dummy = true
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue