File: ip_change.sh

package info (click to toggle)
dtc 0.35.5-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 18,824 kB
  • sloc: php: 50,739; sh: 8,596; makefile: 572; perl: 148; xml: 25
file content (16 lines) | stat: -rwxr-xr-x 338 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh
set -e
. /usr/share/debconf/confmodule

if [ $# -lt 1 ]; then
	echo "Usage: $0 <new ip address>"
	echo "NOTE: You have to be root!"
	exit 1
fi

# Substitute in the values from the debconf db.
# There are obvious optimizations possible here.
db_get dtc/conf_ipaddr
FOO="$RET"
echo "Changing $FOO to $1"
db_set dtc/conf_ipaddr $1