diff options
Diffstat (limited to 'scripts/poky-qemu-ifdown')
| -rwxr-xr-x | scripts/poky-qemu-ifdown | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/scripts/poky-qemu-ifdown b/scripts/poky-qemu-ifdown index 93a87559af..ece2dc998a 100755 --- a/scripts/poky-qemu-ifdown +++ b/scripts/poky-qemu-ifdown | |||
| @@ -1,6 +1,15 @@ | |||
| 1 | #!/bin/bash | 1 | #!/bin/bash |
| 2 | # | 2 | # |
| 3 | # QEMU network interface configuration script. | 3 | # QEMU network configuration script to bring down tap devices. This |
| 4 | # utility needs to be run as root, and will use the tunctl binary | ||
| 5 | # from a Poky sysroot. | ||
| 6 | # | ||
| 7 | # If you find yourself calling this script a lot, you can add the | ||
| 8 | # the following to your /etc/sudoers file to be able to run this | ||
| 9 | # command without entering your password each time: | ||
| 10 | # | ||
| 11 | # <my-username> ALL=NOPASSWD: /path/to/poky-qemu-ifup | ||
| 12 | # <my-username> ALL=NOPASSWD: /path/to/poky-qemu-ifdown | ||
| 4 | # | 13 | # |
| 5 | # Copyright (c) 2006-2010 Intel Corp. | 14 | # Copyright (c) 2006-2010 Intel Corp. |
| 6 | # | 15 | # |
| @@ -18,9 +27,14 @@ | |||
| 18 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | 27 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 19 | 28 | ||
| 20 | usage() { | 29 | usage() { |
| 21 | echo "$0 <tap-dev> <native-sysroot-basedir>" | 30 | echo "sudo $0 <tap-dev> <native-sysroot-basedir>" |
| 22 | } | 31 | } |
| 23 | 32 | ||
| 33 | if [ $EUID -ne 0 ]; then | ||
| 34 | echo "Error: This script (poky-qemu-ifdown) must be run with root privileges" | ||
| 35 | exit 1 | ||
| 36 | fi | ||
| 37 | |||
| 24 | if [ $# -ne 2 ]; then | 38 | if [ $# -ne 2 ]; then |
| 25 | usage | 39 | usage |
| 26 | exit 1 | 40 | exit 1 |
