1#!/usr/bin/env python 2import base64 3import os 4import os.path 5 6# Get the file directory 7fdir = os.path.dirname(os.path.realpath(__file__)) 8 9# Get the shell scripts 10shell_scripts = [f for f in os.listdir(fdir) if f.endswith(".sh")] 11 12# Read each and dump as base64 13for sh in shell_scripts: 14 raw = open(os.path.join(fdir,sh)).read() 15 enc = base64.b64encode(raw) 16 print "Base64 for %s:" % sh 17 print enc 18 print 19 20