from base64 import b64encode
from tempfile import NamedTemporaryFile
+intro = '''
+### autogenerated by samba
+#
+# This file is generated by the gp_scripts_ext Group Policy
+# Client Side Extension. To modify the contents of this file,
+# modify the appropriate Group Policy objects which apply
+# to this machine. DO NOT MODIFY THIS FILE DIRECTLY.
+#
+
+'''
+
class gp_scripts_ext(gp_pol_ext):
def __str__(self):
return 'Unix Settings/Scripts'
if not old_val:
with NamedTemporaryFile(prefix='gp_', mode="w+",
delete=False, dir=cron_dir) as f:
- f.write('#!/bin/sh\n%s' % e.data)
+ contents = '#!/bin/sh\n%s' % intro
+ contents += '%s\n' % e.data
+ f.write(contents)
os.chmod(f.name, 0o700)
self.gp_db.store(str(self), attribute, f.name)
self.gp_db.commit()