Compare commits

...

4 Commits

Author SHA1 Message Date
0f725726c0 latest 2024-05-22 07:43:32 -07:00
2cc47f9398 fix typo 2024-05-22 07:42:10 -07:00
c89910d5f5 fingers faster than brain 2024-05-22 07:41:37 -07:00
a35603f7df add readme 2024-05-22 07:41:21 -07:00
3 changed files with 8 additions and 91 deletions

View File

@@ -0,0 +1,5 @@
# usage
```
curl -sL https://git.eeqj.de/sneak/prov/raw/branch/master/just-authorized-keys/prov.sh | bash
```

View File

@@ -2,7 +2,7 @@
URL="https://dl.sneak.cloud/0000/authorized_keys"
function install_authorized_keys() {
function install_authorized_keys () {
mkdir -p /root/.ssh
curl -sL $URL > /root/.ssh/authorized_keys.new
if [[ $(wc -l /root/.ssh/authorized_keys.new | awk '{print $1}') -gt 0 ]]; then
@@ -14,6 +14,8 @@ function install_authorized_keys() {
fi
chmod 700 /root/.ssh
chmod 600 /root/.ssh/authorized_keys
echo success
exit 0
}
install_authorized_keys

90
prov.sh
View File

@@ -1,90 +0,0 @@
#!/bin/bash
export DEBIAN_FRONTEND=noninteractive
function main() {
RELEASE="$(lsb_release -cs)"
apt update
prov-$RELEASE
}
function install-jq {
if which jq >/dev/null 2>&1 ; then
return
fi
apt install -y jq
}
function install-curl {
if which curl >/dev/null 2>&1 ; then
return
fi
apt install -y curl
}
function detect-mirror-country() {
install-jq
install-curl
curl ipinfo.io | jq -r .country
}
function set-mirror-country() {
MURM="main universe restricted multiverse"
COUNTRY="$(detect-mirror-country)"
URL="http://$COUNTRY.archive.ubuntu.com/ubuntu"
cat > /etc/apt/sources.list.new <<EOF
deb $URL $(lsb_release -cs) $MURM
deb $URL $(lsb_release -cs)-updates $MURM
deb $URL $(lsb_release -cs)-backports $MURM
deb $URL $(lsb_release -cs)-security $MURM
EOF
mv /etc/apt/sources.list.new /etc/apt/sources.list
}
function prov-focal() {
set-mirror-country
PKGS="
bridge-utils
byobu
git
golang-go
magic-wormhole
make
net-tools
nmap
ntp
pbzip2
pv
traceroute
unzip
vim
vlan
wireguard-tools
zip
zsh
zstd
"
apt update && \
apt upgrade -y && \
apt install -y $PKGS && \
apt autoremove -y
install-age
}
function install-age () {
if which age >/dev/null 2>&1 ; then
return
fi
cd /tmp
git clone https://filippo.io/age && cd age
go build -o . filippo.io/age/cmd/...
mv ./age /usr/local/bin
cd -
rm -rf /tmp/age
}
main