summaryrefslogtreecommitdiffstats
path: root/scripts/net-rename
blob: 1a51ffe7b2abc1effe34e8deaa0506936ad3d122 (plain)
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
#!/bin/bash

. /usr/lib/network/globals

case "$1" in
  start)
    report_try "Renaming network devices"
    ifrename -p -t
    report_success

    add_daemon net-rename
    ;;
  stop)
    rm_daemon net-rename
    # No stop neccesary, but add one to look nice on shutdown.
    /bin/true
    ;;
  restart)
    "$0" start
    ;;
  *)
    exit_stderr "Usage: $0 {start|stop|restart}"
    ;;
esac

# vim: ft=sh ts=4 et sw=4: