Skip to content

Scripting

Scripting GPLv3 license

Linuxinit

#!/usr/bin/env bash

#Install
apt-get update -qq >/dev/null && apt upgrade -y
apt install -y htop sudo curl net-tools avahi-daemon avahi-utils
hostnamectl set-hostname ${NODENAME}

# add hostname to /etc/hosts
sed -i "1 s#localhost#localhost ${NODENAME}#g" /etc/hosts

#nano
tee /root/.nanorc <<EOF
set constantshow
EOF

#Disable Swap
sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab
swapoff -a

#sysctl
tee /etc/sysctl.d/debian.conf <<EOF
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_forward = 1
EOF

#Apply & Reboot
sysctl --system
reboot