summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2018-08-12 05:35:20 +0700
committerGitHub <noreply@github.com>2018-08-12 05:35:20 +0700
commitf1720d121911ab14f4925dd9c1075e9d05c8bf79 (patch)
tree2bf5ba922a846dcb128a2a8227d1a01f75f09912 /src
parent5e58b540451fe7892f824bcc6b691c61ffd6a3d7 (diff)
parent12ce8b309d2535ba7277da4561bdd80bb89185be (diff)
downloadvyos-1x-f1720d121911ab14f4925dd9c1075e9d05c8bf79.tar.gz
vyos-1x-f1720d121911ab14f4925dd9c1075e9d05c8bf79.zip
Merge pull request #26 from dsmouse/current
T772 allow stow-away arguments in the script name field https://phabr…
Diffstat (limited to 'src')
-rwxr-xr-xsrc/system/vrrp-script-wrapper.py2
-rwxr-xr-xsrc/validators/script4
2 files changed, 4 insertions, 2 deletions
diff --git a/src/system/vrrp-script-wrapper.py b/src/system/vrrp-script-wrapper.py
index 5d6aa6c55..ce9142b7d 100755
--- a/src/system/vrrp-script-wrapper.py
+++ b/src/system/vrrp-script-wrapper.py
@@ -58,7 +58,7 @@ if (old_state is None) or (old_state != args.state):
syslog.syslog(syslog.LOG_NOTICE, 'Running transition script {0} for VRRP group {1}'.format(args.script, args.group))
try:
- ret = subprocess.call([args.script, args.state, args.interface, args.group])
+ ret = subprocess.call("%s %s %s %s" % ( args.script, args.state, args.interface, args.group), shell=True)
if ret != 0:
syslog.syslog(syslog.LOG_ERR, "Transition script {0} failed, exit status: {1}".format(args.script, ret))
exitcode = ret
diff --git a/src/validators/script b/src/validators/script
index beeba57ae..689296a73 100755
--- a/src/validators/script
+++ b/src/validators/script
@@ -20,6 +20,7 @@
import re
import os
import sys
+import shlex
import vyos.util
@@ -28,7 +29,8 @@ if len(sys.argv) < 2:
print("Please specify script file to check")
sys.exit(1)
-script = sys.argv[1]
+#if the "script" is a script+ stowaway arugments, this removes the aguements
+script = shlex.split(sys.argv[1])[0]
if not os.path.exists(script):
print("File {0} does not exist".format(script))