-
Notifications
You must be signed in to change notification settings - Fork 49
/
startup.sh-2
79 lines (71 loc) · 2.64 KB
/
startup.sh-2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
#
# Perform one-time startup tasks here
# This script will only be run _after_ the partition resizing has
# completed
#
# Copyright (c) 2019 sakaki <[email protected]>
# License: GPL v3+
# NO WARRANTY
#
#################################################################
# Networking setup examples #
#################################################################
# Some simple examples follow.
# Example 1
# To setup WiFi to ESSID "MyWiFi", passphrase "my secret passphrase"
# fixed IP 192.168.1.111/24, DNS 8.8.8.8 and 8.8.4.4 (Google),
# gateway 192.168.1.1, uncomment the following
# (obviously, adapt as appropriate)
#
#echo "Setting up WiFi with fixed IP address..."
#nmcli con del "MyWiFi-fixed-IP"
#nmcli con add con-name "MyWiFi-fixed-IP" type wifi \
# ifname wlan0 ssid "MyWiFi" -- \
# wifi-sec.key-mgmt wpa-psk \
# wifi-sec.psk "my secret passphrase" \
# ipv4.method manual \
# ipv4.address 192.168.1.111/24 \
# ipv4.dns 8.8.8.8,8.8.4.4 \
# ipv4.gateway 192.168.1.1
#nmcli con up "MyWiFi-fixed-IP"
# Example 2
# To setup WiFi to ESSID "MyWiFi", passphrase "my secret passphrase"
# DHCP-assigned (automatic) IP address, gateway and
# DNS, uncomment the following
# (obviously, adapt as appropriate)
#
#echo "Setting up WiFi with automatically assigned address..."
#nmcli con del "MyWiFi-DHCP-IP"
#nmcli con add con-name "MyWiFi-DHCP-IP" type wifi \
# ifname wlan0 ssid "MyWiFi" -- \
# wifi-sec.key-mgmt wpa-psk \
# wifi-sec.psk "my secret passphrase" \
# ipv4.method auto
#nmcli con up "MyWiFi-DHCP-IP"
# Example 3
# To setup the Pi's Ethernet port with a
# fixed IP 192.168.1.111/24, DNS 8.8.8.8 and 8.8.4.4 (Google),
# gateway 192.168.1.1, uncomment the following
# (obviously, adapt as appropriate)
#
#echo "Setting up Ethernet with fixed IP address..."
#nmcli con del "eth0-fixed-IP"
#nmcli con add con-name "eth0-fixed-IP" type ethernet \
# ifname eth0 -- \
# ipv4.method manual \
# ipv4.address 192.168.1.111/24 \
# ipv4.dns 8.8.8.8,8.8.4.4 \
# ipv4.gateway 192.168.1.1
#nmcli con up "eth0-fixed-IP"
# DHCP client on eth0 is enabled automatically in absence
# of any other settings
#################################################################
# Running this script again on next boot #
#################################################################
# The rpi-onetime-startup service that calls this script disables
# itself from further boot-time triggers beforehand, for security.
# However, if you _want_ the service to trigger next boot too,
# re-enable it by uncommenting the following line (you must do
# this _before_ first boot).
#rc-update add rpi-onetime-startup default