diff options
-rwxr-xr-x | setup-interfaces.in | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/setup-interfaces.in b/setup-interfaces.in index 2cde104..b461529 100755 --- a/setup-interfaces.in +++ b/setup-interfaces.in @@ -112,14 +112,7 @@ __EOF__ exit 1 } -while getopts "hi" opt; do - case $opt in - h) usage;; - i) STDINPUT=1;; - esac -done - -if [ "$STDINPUT" != "1" ]; then +prompt_for_interfaces() { init_tmpdir TMP cd $TMP @@ -185,8 +178,18 @@ if [ "$STDINPUT" != "1" ]; then mkdir -p $ROOT/etc/network cp interfaces $ROOT/etc/network/ -else - cat /dev/stdin > interfaces +} + +while getopts "hi" opt; do + case $opt in + h) usage;; + i) STDINPUT=1;; + esac +done + +if [ "$STDINPUT" = "1" ]; then mkdir -p $ROOT/etc/network - cp interfaces $ROOT/etc/network + cat > $ROOT/etc/network/interfaces +else + prompt_for_interfaces fi |