Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Felix Eckhofer
tools
Commits
714bbeb0
Commit
714bbeb0
authored
Mar 29, 2014
by
Felix Eckhofer
🤹🏼
Browse files
Only check for interface state when it exists
parent
386fe397
Changes
1
Hide whitespace changes
Inline
Side-by-side
scripts/randomize-mac/if-post-down.d/randomize-mac
View file @
714bbeb0
...
...
@@ -10,14 +10,15 @@
LOGFILE
=
"
`
mktemp
`
"
IFSTATE
=
"
`
ip addr show dev
\"
$IFACE
\"
2>>
\"
$LOGFILE
\"
`
"
PRESTATE
=
"
`
ip addr show dev
\"
$IFACE
\"
up 2>>
\"
$LOGFILE
\"
`
"
FAILED
=
"0"
if
[
-n
"
$IFSTATE
"
]
;
then
date
>>
"
$LOGFILE
"
echo
"Running randomize-mac for interface '
$IFACE
'"
>>
"
$LOGFILE
"
echo
>>
"
$LOGFILE
"
FAILED
=
"0"
PRESTATE
=
"
`
ip addr show dev
\"
$IFACE
\"
up 2>>
\"
$LOGFILE
\"
`
"
[
-n
"
$PRESTATE
"
]
&&
ip
link set
dev
"
$IFACE
"
down
>>
"
$LOGFILE
"
2>&1
macchanger
-A
"
$IFACE
"
>>
"
$LOGFILE
"
2>&1
||
FAILED
=
1
[
-n
"
$PRESTATE
"
]
&&
ip
link set
dev
"
$IFACE
"
up
>>
"
$LOGFILE
"
2>&1
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment