Rename cjdns related things in preparation for multiple mesh types

This commit is contained in:
Bob Mottram 2015-06-28 10:04:11 +01:00
parent f04d49d5c5
commit 249d9b0f2e
1 changed files with 17 additions and 17 deletions

View File

@ -1187,8 +1187,8 @@ function get_cjdns_password {
fi
}
function install_cjdns {
if grep -Fxq "install_cjdns" $COMPLETION_FILE; then
function mesh_cjdns {
if grep -Fxq "mesh_cjdns" $COMPLETION_FILE; then
return
fi
if [[ $ENABLE_CJDNS != "yes" ]]; then
@ -1396,9 +1396,9 @@ function install_cjdns {
exit 4395
fi
if ! grep -q "# Mesh network" /etc/network/interfaces; then
if ! grep -q "# Mesh network cjdns" /etc/network/interfaces; then
echo '' >> /etc/network/interfaces
echo '# Mesh network' >> /etc/network/interfaces
echo '# Mesh Networking (cjdns)' >> /etc/network/interfaces
echo 'iface eth0 inet6 static' >> /etc/network/interfaces
echo ' pre-up modprobe ipv6' >> /etc/network/interfaces
echo ' address fdfc:0000:0000:0000:0000:0000:0000:0001' >> /etc/network/interfaces
@ -1414,13 +1414,13 @@ function install_cjdns {
ip6tables -A INPUT -i eth0 -p tcp --dport $CJDNS_PORT -j ACCEPT
save_firewall_settings
if ! grep -q "Mesh Networking" /home/$MY_USERNAME/README; then
if ! grep -q "Mesh Networking (cjdns)" /home/$MY_USERNAME/README; then
CURRENT_IP_ADDRESS=$(ip addr show | grep "inet " | sed -n 2p | awk -F ' ' '{print $2}' | awk -F '/' '{print $1}')
echo '' >> /home/$MY_USERNAME/README
echo '' >> /home/$MY_USERNAME/README
echo 'Mesh Networking' >> /home/$MY_USERNAME/README
echo '===============' >> /home/$MY_USERNAME/README
echo 'Mesh Networking (cjdns)' >> /home/$MY_USERNAME/README
echo '=======================' >> /home/$MY_USERNAME/README
echo "cjdns IPv6 address: $CJDNS_IPV6" >> /home/$MY_USERNAME/README
echo "cjdns public key: $CJDNS_PUBLIC_KEY" >> /home/$MY_USERNAME/README
echo "cjdns private key: $CJDNS_PRIVATE_KEY" >> /home/$MY_USERNAME/README
@ -1455,18 +1455,18 @@ function install_cjdns {
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README
fi
echo 'install_cjdns' >> $COMPLETION_FILE
echo 'mesh_cjdns' >> $COMPLETION_FILE
}
function install_cjdns_tools {
if grep -Fxq "install_cjdns_tools" $COMPLETION_FILE; then
function mesh_cjdns_tools {
if grep -Fxq "mesh_cjdns_tools" $COMPLETION_FILE; then
return
fi
if [[ $ENABLE_CJDNS != "yes" ]]; then
return
fi
if [ ! -d /etc/cjdns ]; then
install_cjdns
mesh_cjdns
fi
apt-get -y install golang mercurial
@ -1492,7 +1492,7 @@ function install_cjdns_tools {
# initialise from the cjdns config
/usr/bin/cjdcmd cjdnsadmin -file /etc/cjdns/cjdroute.conf
echo 'install_cjdns_tools' >> $COMPLETION_FILE
echo 'mesh_cjdns_tools' >> $COMPLETION_FILE
}
function remove_instructions_from_motd {
@ -1859,7 +1859,7 @@ function create_backup_script {
echo 'fi' >> /usr/bin/$BACKUP_SCRIPT_NAME
echo '' >> /usr/bin/$BACKUP_SCRIPT_NAME
fi
if grep -Fxq "install_cjdns" $COMPLETION_FILE; then
if grep -Fxq "mesh_cjdns" $COMPLETION_FILE; then
echo "if [ ! -d $USB_MOUNT/backup/cjdns ]; then" >> /usr/bin/$BACKUP_SCRIPT_NAME
echo " mkdir -p $USB_MOUNT/backup/cjdns" >> /usr/bin/$BACKUP_SCRIPT_NAME
echo 'fi' >> /usr/bin/$BACKUP_SCRIPT_NAME
@ -3296,7 +3296,7 @@ function backup_to_friends_servers {
echo 'fi' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME
echo '' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME
fi
if grep -Fxq "install_cjdns" $COMPLETION_FILE; then
if grep -Fxq "mesh_cjdns" $COMPLETION_FILE; then
echo 'if [ ! -d $SERVER_DIRECTORY/backup/cjdns ]; then' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME
echo ' mkdir -p $SERVER_DIRECTORY/backup/cjdns' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME
echo 'fi' >> /usr/bin/$BACKUP_TO_FRIENDS_SCRIPT_NAME
@ -8798,7 +8798,7 @@ function create_upgrade_script {
echo 'git stash drop' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
echo 'git pull' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
fi
if grep -Fxq "install_cjdns" $COMPLETION_FILE; then
if grep -Fxq "mesh_cjdns" $COMPLETION_FILE; then
echo '' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
echo '# cjdns' >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
echo "cd /etc/cjdns" >> /etc/cron.weekly/$UPGRADE_SCRIPT_NAME
@ -9240,8 +9240,8 @@ set_your_domain_name
time_synchronisation
configure_internet_protocol
create_git_project
install_cjdns
install_cjdns_tools
mesh_cjdns
mesh_cjdns_tools
backup_github_projects
configure_ssh
remove_instructions_from_motd