Merge ~xnox/casper:ask-netmask into casper:main

Proposed by Dimitri John Ledkov
Status: Merged
Merged at revision: 6b71e75ca966ba1cdae68756eecd6910b1243562
Proposed branch: ~xnox/casper:ask-netmask
Merge into: casper:main
Diff against target: 31 lines (+5/-9)
1 file modified
scripts/casper (+5/-9)
Reviewer Review Type Date Requested Status
Michael Hudson-Doyle Approve
Review via email: mp+386182@code.launchpad.net

Commit message

casper: ask user for netmask, because we lack CIDR notation support

Based on user feedback, one needs a way to specify netmask.

To post a comment you must log in.
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Sure.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/scripts/casper b/scripts/casper
2index cd03800..f1d09ee 100644
3--- a/scripts/casper
4+++ b/scripts/casper
5@@ -332,6 +332,11 @@ do_interactive_netmount() {
6 static|off|none)
7 proto=none
8 read -p "ip: " ipaddr
9+ default_netmask=255.255.255.0
10+ read -p "netmask (default $default_netmask): " netmask
11+ if [ -z "$netmask" ]; then
12+ netmask=$default_netmask
13+ fi
14 default_gw=${ipaddr%.*}.1
15 read -p "gateway (default $default_gw): " gateway
16 if [ -z "$gateway" ]; then
17@@ -413,15 +418,6 @@ do_interactive_netmount() {
18 fi
19
20 if [ "$proto" = "none" ]; then
21- case $ipaddr in
22- *.*)
23- netmask=255.255.255.0
24- ;;
25- *:*)
26- # I don't think we support static ipv6
27- netmask=
28- ;;
29- esac
30 export IP=$ipaddr::$gateway:$netmask::$DEVICE:$proto:$dns
31 fi
32

Subscribers

People subscribed via source and target branches