TurnKey Linux Virtual Appliance Library

TKLPatch conf settings to append line to other config file?

The TKLPatch conf file below does not seem to be making any lasting changes to /etc/bash.bashrc file!

Any suggestions as to how I can append the required info to a file while making in new ISO?

Thanks

 


#!/bin/bash -ex
install()
{
    apt-get update
    DEBIAN_FRONTEND=noninteractive apt-get -y \
        -o DPkg::Options::=--force-confdef \
        -o DPkg::Options::=--force-confold \
        install $@
}

cleanup_apt()
    {
        rm -r /var/cache/apt/*
        mkdir /var/cache/apt/archives
        mkdir /var/cache/apt/archives/partial
    }


HOSTNAME=pentland

# set hostname
echo "$HOSTNAME" > /etc/hostname
sed -i "s|127.0.1.1 \(.*\)|127.0.1.1 $HOSTNAME|" /etc/hosts

echo "# setup apps to use cntlm proxy" >> /etc/bash.bachrc
echo "export ftp_proxy=http://localhost:9090" >> /etc/bash.bachrc
echo "export http_proxy=\$ftp_proxy" >> /etc/bash.bachrc
echo "export https_proxy=\$ftp_proxy" >> /etc/bash.bachrc

cleanup_apt

# tell the world what we've done!
echo 'I just patched TurnKey!' >> /etc/issue


Liraz Siri's picture

Typo in your script

/etc/bash.bachrc => /etc/bash.bashrc.

Sometimes it's the simplest things that trip us up!

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)