Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
cyclopticnerve committed Oct 1, 2022
0 parents commit 1c3c131
Show file tree
Hide file tree
Showing 5 changed files with 774 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"todo-tree.tree.scanMode": "workspace only"
}
21 changes: 21 additions & 0 deletions _root/run_as_root.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
'general': {
'run_as_root': 0,
'prog_name': '',
'disp_name': ''
},


# check for run as root/need to run as root
run_as_root = self.conf_dict['general']['run_as_root']
file_name = os.path.basename(__file__)
run_root = (os.geteuid() == 0)
if run_as_root and not run_root:
msg = 'This script needs to be run as root. '\
f'Try \'sudo ./{file_name}\''
print(msg)
exit()
elif not run_as_root and run_root:
msg = 'This script should not be run as root. '\
f'Try \'./{file_name}\''
print(msg)
exit()
27 changes: 27 additions & 0 deletions install.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"general": {
"prog_name": "SpaceOddity"
},
"preflight": [
],
"sys_reqs": [
],
"py_reqs": [
"python-crontab"
],
"dirs": [
"${HOME}/.spaceoddity",
"${HOME}/.config/spaceoddity"
],
"files": {
"spaceoddity.py": "${HOME}/.spaceoddity",
"uninstall.py": "${HOME}/.spaceoddity",
"LICENSE": "${HOME}/.spaceoddity",
"VERSION": "${HOME}/.spaceoddity"
},
"postflight": [
"convert_json.py",
"cron_install.py",
"${HOME}/.spaceoddity/spaceoddity.py"
]
}
Loading

0 comments on commit 1c3c131

Please sign in to comment.