This commit is contained in:
mbecker20
2023-08-17 01:36:11 -04:00
parent 10beeab4b5
commit e31443b285
3 changed files with 40 additions and 13 deletions

View File

@@ -0,0 +1,27 @@
#!/bin/bash
BIN_PATH=$HOME/.monitor/bin
mkdir -p $BIN_PATH
echo "\ndownloading monitor periphery...\n"
systemctl --user stop periphery # in case its currently in use
curl -L https://github.com/mbecker20/monitor/releases/download/v1.0.0.next/periphery > $BIN_PATH/periphery
chmod +x $BIN_PATH/periphery
# this adds $HOME/.monitor/bin to path
if ! grep ".monitor/bin" $HOME/.bashrc > /dev/null; then
echo "" >> $HOME/.bashrc
echo "export PATH=$HOME/.monitor/bin:\$PATH" >> ~/.bashrc
fi
export PATH="$HOME/.monitor/bin:$PATH"
if ! test -f "$HOME/.monitor/periphery.config.toml"; then
monitor periphery gen-config
fi
if pgrep periphery > /dev/null; then
systemctl --user restart periphery
else
monitor periphery start systemd --yes
fi