diff options
author | Ivan Shapovalov <intelfx100@gmail.com> | 2013-02-12 13:39:09 +0100 |
---|---|---|
committer | Jouke Witteveen <j.witteveen@gmail.com> | 2013-02-14 22:28:43 +0100 |
commit | b0f92895e6c5ca54a6c8e9ed7ed6db2816d54d8a (patch) | |
tree | 58507b211f8c370035b8b2e3e7e0dff32368c4cf /src | |
parent | c5e26b20745037e1edda0288a4f08352c9097768 (diff) | |
download | netctl-b0f92895e6c5ca54a6c8e9ed7ed6db2816d54d8a.tar.gz netctl-b0f92895e6c5ca54a6c8e9ed7ed6db2816d54d8a.tar.xz |
Automatically escape dashes in interface names
Custom interface names like "eth-phone" or "eth-lte" are not uncommon,
and since they are used in pathes inside systemd units, dashes and unprintable
characters shall be escaped per unit file rules.
So replace "-" with "\x2d" in interface names.
Diffstat (limited to 'src')
-rwxr-xr-x | src/netctl | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -89,6 +89,7 @@ unit_enable() { echo -e "\n[Unit]" >> "$unit" [[ -n $Description ]] && echo "Description=$Description" >> "$unit" : ${BindsToInterfaces=$Interface} + BindsToInterfaces=( "${BindsToInterfaces[@]//-/\\x2d}" ) printf 'BindsTo=sys-subsystem-net-devices-%s.device\n' \ "${BindsToInterfaces[@]}" >> "$unit" printf 'After=sys-subsystem-net-devices-%s.device\n' \ |