Skip to content

Instantly share code, notes, and snippets.

@atpons
Last active January 27, 2018 02:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atpons/424069a45e54eeea9abd6e939779186a to your computer and use it in GitHub Desktop.
Save atpons/424069a45e54eeea9abd6e939779186a to your computer and use it in GitHub Desktop.
Raspberry Pi の IP アドレス固定化 + ssh 自動接続
#!/bin/bash
# Usage: ./autoconfig.sh IP_ADDRESS DEFAULT_GATEWAY
echo "[*] fix ip addr"
sudo cat <<EOF >> /etc/dhcpcd.conf
interface eth0
static ip_address=$1
static routers=$2
static domain_name_servers=$2
EOF
echo "[*] enable ssh"
sudo systemctl enable ssh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment