add install step
Signed-off-by: Xe Iaso <me@christine.website>
This commit is contained in:
parent
5aa1f61f1d
commit
4ae233dbcf
|
@ -0,0 +1,16 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo "installing tailscale" | logger
|
||||||
|
|
||||||
|
systemctl stop tailscaled.service ||:
|
||||||
|
systemd-sysext unmerge ||:
|
||||||
|
|
||||||
|
mkdir -p /etc/extensions/tailscale
|
||||||
|
mkdir -p /home/deck/.local/share/tailscale/steamos
|
||||||
|
wget -O /home/deck/.local/share/tailscale/steamos/tailscale_sysext_1.24.2.tar.gz https://xena.greedo.xeserv.us/pkg/ts-sysext/tailscale_sysext_1.24.2.tar.gz
|
||||||
|
|
||||||
|
tar xzf /home/deck/.local/share/tailscale/steamos/tailscale_sysext_1.24.2.tar.gz -C /etc/extensions/tailscale
|
||||||
|
systemd-sysext merge
|
||||||
|
systemctl start tailscaled.service
|
8
main.py
8
main.py
|
@ -16,7 +16,7 @@ class Plugin:
|
||||||
result = subprocess.run(["/bin/sh", "-c", "systemctl status tailscaled.service | grep active"], stdout=subprocess.PIPE)
|
result = subprocess.run(["/bin/sh", "-c", "systemctl status tailscaled.service | grep active"], stdout=subprocess.PIPE)
|
||||||
return result.stdout.decode("utf-8").split(": ")[1].strip()
|
return result.stdout.decode("utf-8").split(": ")[1].strip()
|
||||||
|
|
||||||
async def _install_state(self):
|
async def install_state(self):
|
||||||
sysext = subprocess.run(["/usr/bin/systemd-sysext", "list", "--json=short"], stdout=subprocess.PIPE)
|
sysext = subprocess.run(["/usr/bin/systemd-sysext", "list", "--json=short"], stdout=subprocess.PIPE)
|
||||||
sysexts = json.loads(sysext.stdout.decode("utf-8"))
|
sysexts = json.loads(sysext.stdout.decode("utf-8"))
|
||||||
|
|
||||||
|
@ -31,10 +31,8 @@ class Plugin:
|
||||||
|
|
||||||
return "impossible state"
|
return "impossible state"
|
||||||
|
|
||||||
async def install_state(self, *args):
|
async def install(self, *args):
|
||||||
result = await self._install_state()
|
subprocess.run(["/home/deck/homebrew/plugins/tailscale/deck_install.sh"])
|
||||||
await self.log("status: " + result)
|
|
||||||
return result
|
|
||||||
|
|
||||||
# Asyncio-compatible long-running code, executed in a task when the plugin is loaded
|
# Asyncio-compatible long-running code, executed in a task when the plugin is loaded
|
||||||
async def _main(self):
|
async def _main(self):
|
||||||
|
|
|
@ -17,21 +17,18 @@
|
||||||
return call_plugin_method("install_state", {});
|
return call_plugin_method("install_state", {});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function doInstall() {
|
||||||
|
return call_plugin_method("install", {});
|
||||||
|
}
|
||||||
|
|
||||||
async function getStatus() {
|
async function getStatus() {
|
||||||
await log("getting status");
|
|
||||||
let status = document.getElementById("status");
|
|
||||||
let installStatus = await getInstallState();
|
let installStatus = await getInstallState();
|
||||||
|
let status = document.getElementById("status");
|
||||||
status.innerText = `${installStatus}`;
|
status.innerText = `${installStatus}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function onReady() {
|
|
||||||
log("test hi here what's up");
|
|
||||||
}
|
|
||||||
log("log message");
|
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="onReady()">
|
<body onload="onReady()">
|
||||||
<h2 id="heading">Hello World</h2>
|
|
||||||
<div class="gamepaddialog_Field_eKmEX gamepaddialog_WithFirstRow_2bDqk gamepaddialog_InlineWrapShiftsChildrenBelow_3LCXh gamepaddialog_WithBottomSeparator_3YKpU gamepaddialog_ExtraPaddingOnChildrenBelow_3nLNL gamepaddialog_StandardPadding_xIITX gamepaddialog_HighlightOnFocus_2HFrm Panel Focusable"
|
<div class="gamepaddialog_Field_eKmEX gamepaddialog_WithFirstRow_2bDqk gamepaddialog_InlineWrapShiftsChildrenBelow_3LCXh gamepaddialog_WithBottomSeparator_3YKpU gamepaddialog_ExtraPaddingOnChildrenBelow_3nLNL gamepaddialog_StandardPadding_xIITX gamepaddialog_HighlightOnFocus_2HFrm Panel Focusable"
|
||||||
style="--indent-level:0;">
|
style="--indent-level:0;">
|
||||||
<div class="gamepaddialog_FieldLabelRow_2VcTl">
|
<div class="gamepaddialog_FieldLabelRow_2VcTl">
|
||||||
|
@ -40,6 +37,10 @@
|
||||||
class="DialogButton _DialogLayout Secondary gamepaddialog_Button_cXzBZ Focusable" onclick="getStatus()"
|
class="DialogButton _DialogLayout Secondary gamepaddialog_Button_cXzBZ Focusable" onclick="getStatus()"
|
||||||
tabindex="0">🔄</button></div>
|
tabindex="0">🔄</button></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="gamepaddialog_FieldChildren_2rhav"><button type="button"
|
||||||
|
class="DialogButton _DialogLayout Secondary gamepaddialog_Button_cXzBZ Focusable" onclick="doInstall()"
|
||||||
|
tabindex="0">Install</button></div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in New Issue