summaryrefslogtreecommitdiff
path: root/install.sh
blob: 0141b839dc5053971c13d18969ade94beda9bd5d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/bash

sudo cp sshd_config /etc/sshd_config

HOME=$(getent passwd "$USER" | cut -d: -f6)
mkdir -p "$HOME/.local/bin/"
cp refresh_keys.sh "$HOME/.local/bin"

MIN=$(( 0x$(hostname | md5sum | cut -c1-15) % 30 ))
JOB="*/$MIN * * * * $HOME/.local/bin/refresh_keys.sh"
( crontab -l 2>/dev/null | grep -vF 'refresh_keys.sh'; echo "$JOB" ) | crontab -