diff --git a/os/raspberrypi2-raspbian/helpers.sh b/os/raspberrypi2-raspbian/helpers.sh index 37e4403..9c6fc7f 100755 --- a/os/raspberrypi2-raspbian/helpers.sh +++ b/os/raspberrypi2-raspbian/helpers.sh @@ -1,17 +1,17 @@ #!/bin/sh -function update-os { +update_os() { # Updating sudo apt-get update -y sudo apt-get upgrade -y } -function remove-bad-package { +remove_bad_package() { for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do sudo apt-get remove $pkg; done sudo apt autoremove -y } -function instsall-core-package { +instsall_core_package() { sudo apt install -y \ git \ jq \ @@ -19,7 +19,7 @@ function instsall-core-package { sh <(curl -L https://nixos.org/nix/install) --daemon } -function install-docker { +install_docker() { echo "Add Docker's official GPG key..." sudo apt-get install ca-certificates curl gnupg sudo install -m 0755 -d /etc/apt/keyrings @@ -42,45 +42,44 @@ function install-docker { docker-compose-plugin } -function install-docker-compose-systemd { +install_docker_compose_systemd() { sudo mkdir -p /etc/docker/compose/ sudo cp systemd/docker-compose@.service /etc/systemd/system/docker-compose@.service } -function mount-nfs-torrents { +mount_nfs_torrents() { sudo cp /etc/fstab /etc/fstab.backup sudo mkdir -p /torrents sudo echo "truenas.local:/mnt/EightTerra/DownloadedTorrents /torrents/ nfs auto 0 0" | sudo tee -a /etc/fstab sudo mount -a } -function install-qbittorrent { +install_qbittorrent() { sudo useradd -r -m qbittorrent - sudo usermod -a -G qbittorrent $USER + sudo usermod -a -G qbittorrent "$USER" sudo apt install -y qbittorrent-nox sudo cp systemd/qbittorrent.service /etc/systemd/system/qbittorrent.service sudo systemctl start qbittorrent sudo systemctl enable qbittorrent } -function install-speedtest-cli { - mkdir -p $HOME/.local/bin - mkdir -p $HOME/tmp/speedtest - pushd $HOME/tmp/speedtest/ +install_speedtest_cli() { + mkdir -p "$HOME"/.local/bin + mkdir -p "$HOME"/tmp/speedtest + pushd "$HOME"/tmp/speedtest/ || exit 1 wget https://github.com/librespeed/speedtest-cli/releases/download/v1.0.10/librespeed-cli_1.0.10_linux_armv7.tar.gz tar -xvf librespeed-cli_1.0.10_linux_armv7.tar.gz - cp librespeed-cli $HOME/.local/bin/speedtest-cli - popd - rm -rf $HOME/tmp/speedtest + cp librespeed-cli "$HOME"/.local/bin/speedtest-cli + rm -rf "$HOME"/tmp/speedtest } -function install-transmission { +install_transmission() { sudo apt-get install transmission-daemon sudo ufw allow 9091,51413/tcp } -function set-static-ip() { +set_static_ip() { ip=${1} intf=${2:-eth0} routerip=${3:-192.168.8.1} @@ -93,7 +92,7 @@ static ip_address=$ip/24 " | tee -a /etc/dhcpcd.conf } -function install-openvpn { +install_openvpn() { sudo apt install openvpn - sudo cp systemd/openvpn.service /etc/systemd/system/openvpn-client.service + sudo cp systemd/openvpn-client.service /etc/systemd/system/openvpn-client.service } \ No newline at end of file