summaryrefslogtreecommitdiff
path: root/pkg/linux
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/linux')
-rwxr-xr-xpkg/linux/bitmask-root12
1 files changed, 11 insertions, 1 deletions
diff --git a/pkg/linux/bitmask-root b/pkg/linux/bitmask-root
index d1bf656e..2c423da1 100755
--- a/pkg/linux/bitmask-root
+++ b/pkg/linux/bitmask-root
@@ -51,6 +51,7 @@ cmdcheck = subprocess.check_output
## CONSTANTS
##
+VERSION = "1"
SCRIPT = "bitmask-root"
NAMESERVER = "10.42.0.1"
BITMASK_CHAIN = "bitmask"
@@ -819,7 +820,12 @@ def firewall_stop():
def main():
- if len(sys.argv) >= 3:
+ """
+ Entry point for cmdline execution.
+ """
+ # TODO use argparse instead.
+
+ if len(sys.argv) >= 2:
command = "_".join(sys.argv[1:3])
args = sys.argv[3:]
@@ -828,6 +834,10 @@ def main():
is_restart = True
args.remove('restart')
+ if command == "version":
+ print(VERSION)
+ exit(0)
+
if command == "openvpn_start":
openvpn_start(args)