File: dump_user_data.py

package info (click to toggle)
golang-github-hashicorp-serf 0.8.1%2Bgit20180508.80ab4877~ds-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,276 kB
  • sloc: sh: 412; python: 11; makefile: 7
file content (19 lines) | stat: -rwxr-xr-x 421 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env python
import base64
import os
import os.path

# Get the file directory
fdir = os.path.dirname(os.path.realpath(__file__))

# Get the shell scripts
shell_scripts = [f for f in os.listdir(fdir) if f.endswith(".sh")]

# Read each and dump as base64
for sh in shell_scripts:
    raw = open(os.path.join(fdir,sh)).read()
    enc = base64.b64encode(raw)
    print "Base64 for %s:" % sh
    print enc
    print