Merge branch 'master' of https://git.johnhgaunt.com/jgaunt/homelab-scripts
This commit is contained in:
@@ -3,13 +3,13 @@
|
||||
# CyberChef web directory
|
||||
CYBERCHEF_DIRECTORY="/var/www/public/cyberchef"
|
||||
# download srouce code of latest releases page
|
||||
HTML_SOURCE=$(wget -O - https://api.github.com/repos/gchq/CyberChef/releases/latest)
|
||||
CYBERCHEF_RELEASES_API=$(wget -O - https://api.github.com/repos/gchq/CyberChef/releases/latest)
|
||||
# version
|
||||
VERSION=$(echo ${HTML_SOURCE} | jq -r .tag_name)
|
||||
VERSION=$(echo ${CYBERCHEF_RELEASES_API} | jq -r .tag_name)
|
||||
# get download url
|
||||
DOWNLOAD_URL=$(echo ${HTML_SOURCE} | jq -r .assets[].browser_download_url)
|
||||
DOWNLOAD_URL=$(echo ${CYBERCHEF_RELEASES_API} | jq -r .assets[].browser_download_url)
|
||||
# get filename
|
||||
FILENAME=$(echo ${HTML_SOURCE} | jq -r .assets[].name)
|
||||
FILENAME=$(echo ${CYBERCHEF_RELEASES_API} | jq -r .assets[].name)
|
||||
|
||||
# test if version is already downloaded
|
||||
if [ $(ls ${CYBERCHEF_DIRECTORY}/*${VERSION}* | wc -l) -gt 0 ]; then
|
||||
|
||||
34
update.sh
34
update.sh
@@ -44,7 +44,7 @@ if [ ${OS} == "Debian" ] || [ ${OS} == "Ubuntu" ]; then
|
||||
apt update; apt upgrade -y
|
||||
|
||||
# install the packages on all systems
|
||||
apt install -y apt-transport-https wget tar gnupg2 sudo dnsutils rsync nano htop nload iperf iperf3 unattended-upgrades unzip bzip2 git nfs-common uptimed net-tools build-essential curl realmd oddjob oddjob-mkhomedir sssd sssd-tools libnss-sss libpam-sss adcli mlocate ncdu wireguard clevis
|
||||
apt install -y apt-transport-https wget tar gnupg2 sudo dnsutils rsync nano htop nload iperf iperf3 unattended-upgrades unzip bzip2 git nfs-common uptimed net-tools build-essential curl realmd oddjob oddjob-mkhomedir sssd sssd-tools libnss-sss libpam-sss adcli ncdu wireguard clevis jq
|
||||
|
||||
# enable unattended-upgrades
|
||||
echo unattended-upgrades unattended-upgrades/enable_auto_updates boolean true | debconf-set-selections
|
||||
@@ -62,6 +62,13 @@ if [ ${OS} == "Debian" ] || [ ${OS} == "Ubuntu" ]; then
|
||||
apt install -y qemu-guest-agent
|
||||
fi
|
||||
|
||||
# FastFetch install
|
||||
#FASTFETCH_FILENAME="fastfetch-linux-amd64.deb"
|
||||
# download srouce code of latest releases page
|
||||
FASTFETCH_RELEASES_API=$(wget -O - https://api.github.com/repos/fastfetch-cli/fastfetch/releases/latest)
|
||||
DOWNLOAD_URL=$(echo ${FASTFETCH_RELEASES_API} | jq -r '.assets[].browser_download_url | select(. | endswith("fastfetch-linux-amd64.deb"))')
|
||||
wget -P /tmp ${DOWNLOAD_URL}
|
||||
apt install --yes /tmp/fastfetch-linux-amd64.deb
|
||||
|
||||
# remove unneeded packages
|
||||
apt autoremove -y
|
||||
@@ -91,7 +98,7 @@ elif [ "${OS}" == "CentOS" ] || [ "${OS}" == "Rocky" ]; then
|
||||
yum autoremove -y
|
||||
|
||||
# install the packages
|
||||
yum install -y sudo rsync tar nano htop nload iperf iperf3 bind-utils yum-cron unzip bzip2 nfs-utils git wget uptimed net-tools make realmd oddjob oddjob-mkhomedir sssd adcli mlocate ncdu wireguard clevis
|
||||
yum install -y sudo rsync tar nano htop nload iperf iperf3 bind-utils yum-cron unzip bzip2 nfs-utils git wget uptimed net-tools make realmd oddjob oddjob-mkhomedir sssd adcli ncdu wireguard clevis jq
|
||||
|
||||
# install vm tools
|
||||
if [ "${VM}" == "true" ]; then
|
||||
@@ -129,7 +136,7 @@ elif [ "${OS}" == "CentOS" ] || [ "${OS}" == "Rocky" ]; then
|
||||
dnf autoremove -y
|
||||
|
||||
# install the packages
|
||||
dnf install -y sudo rsync tar nano htop iperf3 bind-utils unzip bzip2 nfs-utils git wget net-tools make dnf-automatic realmd oddjob oddjob-mkhomedir sssd adcli mlocate ncdu wireguard clevis
|
||||
dnf install -y sudo rsync tar nano htop iperf3 bind-utils unzip bzip2 nfs-utils git wget net-tools make dnf-automatic realmd oddjob oddjob-mkhomedir sssd adcli ncdu wireguard clevis jq
|
||||
|
||||
# enable automatic updates
|
||||
sed --in-place "s/^apply_updates\ =\ no/apply_updates\ =\ yes/" /etc/dnf/automatic.conf
|
||||
@@ -142,6 +149,15 @@ elif [ "${OS}" == "CentOS" ] || [ "${OS}" == "Rocky" ]; then
|
||||
if [ "${KVM}" == "true" ]; then
|
||||
dnf install -y qemu-guest-agent
|
||||
fi
|
||||
|
||||
# FastFetch install
|
||||
#FASTFETCH_FILENAME="fastfetch-linux-amd64.deb"
|
||||
# download srouce code of latest releases page
|
||||
FASTFETCH_RELEASES_API=$(wget -O - https://api.github.com/repos/fastfetch-cli/fastfetch/releases/latest)
|
||||
DOWNLOAD_URL=$(echo ${FASTFETCH_RELEASES_API} | jq -r '.assets[].browser_download_url | select(. | endswith("fastfetch-linux-amd64.rpm"))')
|
||||
wget -P /tmp ${DOWNLOAD_URL}
|
||||
dnf install -y /tmp/fastfetch-linux-amd64.rpm
|
||||
|
||||
fi
|
||||
|
||||
# modify ssh to allow root login and then restart the service
|
||||
@@ -171,17 +187,5 @@ else
|
||||
git clone https://git.johnhgaunt.com/jgaunt/homelab-scripts
|
||||
fi
|
||||
|
||||
# install neofetch
|
||||
if [ -d /opt/neofetch ]; then
|
||||
cd /opt/neofetch
|
||||
git pull --ff-only
|
||||
make install
|
||||
else
|
||||
cd /opt
|
||||
git clone https://github.com/dylanaraps/neofetch
|
||||
cd /opt/neofetch
|
||||
make install
|
||||
fi
|
||||
|
||||
# go to home directory
|
||||
cd ~
|
||||
|
||||
Reference in New Issue
Block a user