Charles K.'s picture

I am working on updating the patch that adds located here:

so that it will work with the current version of tklcore and give the option to install JAVA 1.7

I am having an issue trying to get the inithook to run a bash shell script. Here is a snippet of my code. Once the bash shell script has ran I want it to come back to the interactive screen like it does when updates are installed. file

# Copyright (c) 2010 Alon Swartz <>
"""Accept Oracle Licence Agreement"""

import sys
import getopt
import signal

from executil import ExecError, getoutput, system
from dialog_wrapper import Dialog

TEXT = """Do you accept the Oracle Binary Code License Agreement for Java SE located here:

If not accepted, Default-JDK will be installed instead.

This can take a few minutes. You need to be online.

CONNECTIVITY_ERROR = """Unable to connect to package archive.

Please try again once your network settings are configured by using the following shell command (output will be available in /var/log/cron-apt/log):


TEXT2 = """    if [ -d /usr/lib/jvm ]
        echo "/usr/lib/jvm directory  exists!"
        echo "/usr/lib/jvm directory not found!"
        echo "Creating directory now."
        mkdir /usr/lib/jvm


def usage(s=None):
    if s:
        print >> sys.stderr, "Error:", s
    print >> sys.stderr, "Syntax: %s [options]" % sys.argv[0]
    print >> sys.stderr, __doc__

def main():
    signal.signal(signal.SIGINT, signal.SIG_IGN)
        opts, args = getopt.gnu_getopt(sys.argv[1:], "h", ['help'])
    except getopt.GetoptError, e:

    for opt, val in opts:
        if opt in ('-h', '--help'):

    d = Dialog("TurnKey Linux - First boot configuration")
    accept = d.yesno("Accept Oracle Licence Agreement", TEXT, "Accept", "Skip")

    if not accept:


       getoutput("/usr/bin/sh /root/")
    except ExecError, e:


#       getoutput("host -W 2")
#    except ExecError, e:
#        d.error(CONNECTIVITY_ERROR)
#        sys.exit(1)

if __name__ == "__main__":



Add new comment