Moving apps to share

This commit is contained in:
Bob Mottram 2016-07-06 19:45:58 +01:00
parent 18d62a43b9
commit 94b3b80aa9
6 changed files with 246 additions and 310 deletions

View File

@ -626,11 +626,7 @@ function mesh_firewall {
function mesh_tox_node { function mesh_tox_node {
# obtain commits from the main file # obtain commits from the main file
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then TOXCORE_COMMIT_MAIN=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-tox | grep "TOXCORE_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
TOXCORE_COMMIT_MAIN=$(cat /usr/local/bin/${PROJECT_NAME}-app-tox | grep "TOXCORE_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
else
TOXCORE_COMMIT_MAIN=$(cat /usr/bin/${PROJECT_NAME}-app-tox | grep "TOXCORE_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
fi
if [ ${#TOXCORE_COMMIT_MAIN} -gt 10 ]; then if [ ${#TOXCORE_COMMIT_MAIN} -gt 10 ]; then
TOXCORE_COMMIT=$TOXCORE_COMMIT_MAIN TOXCORE_COMMIT=$TOXCORE_COMMIT_MAIN
fi fi
@ -639,11 +635,7 @@ function mesh_tox_node {
exit 76325 exit 76325
fi fi
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then TOX_PORT_MAIN=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-tox | grep "TOX_PORT=" | head -n 1 | awk -F '=' '{print $2}')
TOX_PORT_MAIN=$(cat /usr/local/bin/${PROJECT_NAME}-app-tox | grep "TOX_PORT=" | head -n 1 | awk -F '=' '{print $2}')
else
TOX_PORT_MAIN=$(cat /usr/bin/${PROJECT_NAME}-app-tox | grep "TOX_PORT=" | head -n 1 | awk -F '=' '{print $2}')
fi
if [ ${#TOX_PORT_MAIN} -gt 2 ]; then if [ ${#TOX_PORT_MAIN} -gt 2 ]; then
TOX_PORT=$TOX_PORT_MAIN TOX_PORT=$TOX_PORT_MAIN
fi fi
@ -652,11 +644,7 @@ function mesh_tox_node {
exit 32856 exit 32856
fi fi
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then TOXCORE_REPO_MAIN=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-tox | grep "TOXCORE_REPO=" | head -n 1 | awk -F '"' '{print $2}')
TOXCORE_REPO_MAIN=$(cat /usr/local/bin/${PROJECT_NAME}-app-tox | grep "TOXCORE_REPO=" | head -n 1 | awk -F '"' '{print $2}')
else
TOXCORE_REPO_MAIN=$(cat /usr/bin/${PROJECT_NAME}-app-tox | grep "TOXCORE_REPO=" | head -n 1 | awk -F '"' '{print $2}')
fi
if [ ${#TOXCORE_REPO_MAIN} -gt 10 ]; then if [ ${#TOXCORE_REPO_MAIN} -gt 10 ]; then
TOXCORE_REPO=$TOXCORE_REPO_MAIN TOXCORE_REPO=$TOXCORE_REPO_MAIN
fi fi
@ -767,11 +755,7 @@ function mesh_tox_avahi {
exit 87359 exit 87359
fi fi
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then TOXID_REPO_MAIN=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-tox | grep "TOXID_REPO=" | head -n 1 | awk -F '"' '{print $2}')
TOXID_REPO_MAIN=$(cat /usr/local/bin/${PROJECT_NAME}-app-tox | grep "TOXID_REPO=" | head -n 1 | awk -F '"' '{print $2}')
else
TOXID_REPO_MAIN=$(cat /usr/bin/${PROJECT_NAME}-app-tox | grep "TOXID_REPO=" | head -n 1 | awk -F '"' '{print $2}')
fi
if [ ${#TOXID_REPO_MAIN} -gt 5 ]; then if [ ${#TOXID_REPO_MAIN} -gt 5 ]; then
TOXID_REPO=$TOXID_REPO_MAIN TOXID_REPO=$TOXID_REPO_MAIN
fi fi
@ -814,27 +798,15 @@ function mesh_tox_avahi {
} }
function mesh_tox_client { function mesh_tox_client {
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then TOXIC_FILE=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-tox | grep "TOXIC_FILE=" | head -n 1 | awk -F '=' '{print $2}')
TOXIC_FILE=$(cat /usr/local/bin/${PROJECT_NAME}-app-tox | grep "TOXIC_FILE=" | head -n 1 | awk -F '=' '{print $2}')
else
TOXIC_FILE=$(cat /usr/bin/${PROJECT_NAME}-app-tox | grep "TOXIC_FILE=" | head -n 1 | awk -F '=' '{print $2}')
fi
# obtain commits from the main file # obtain commits from the main file
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then TOXIC_COMMIT_MAIN=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-tox | grep "TOXIC_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
TOXIC_COMMIT_MAIN=$(cat /usr/local/bin/${PROJECT_NAME}-app-tox | grep "TOXIC_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
else
TOXIC_COMMIT_MAIN=$(cat /usr/bin/${PROJECT_NAME}-app-tox | grep "TOXIC_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
fi
if [ ${#TOXIC_COMMIT_MAIN} -gt 10 ]; then if [ ${#TOXIC_COMMIT_MAIN} -gt 10 ]; then
TOXIC_COMMIT=$TOXIC_COMMIT_MAIN TOXIC_COMMIT=$TOXIC_COMMIT_MAIN
fi fi
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then TOXIC_REPO_MAIN=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-tox | grep "TOXIC_REPO=" | head -n 1 | awk -F '"' '{print $2}')
TOXIC_REPO_MAIN=$(cat /usr/local/bin/${PROJECT_NAME}-app-tox | grep "TOXIC_REPO=" | head -n 1 | awk -F '"' '{print $2}')
else
TOXIC_REPO_MAIN=$(cat /usr/bin/${PROJECT_NAME}-app-tox | grep "TOXIC_REPO=" | head -n 1 | awk -F '"' '{print $2}')
fi
if [ ${#TOXIC_REPO_MAIN} -gt 5 ]; then if [ ${#TOXIC_REPO_MAIN} -gt 5 ]; then
TOXIC_REPO=$TOXIC_REPO_MAIN TOXIC_REPO=$TOXIC_REPO_MAIN
fi fi
@ -858,11 +830,7 @@ function mesh_tox_client {
chmod +x $TEMP_SCRIPT chmod +x $TEMP_SCRIPT
cp $TEMP_SCRIPT $rootdir/root/ cp $TEMP_SCRIPT $rootdir/root/
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then TOXIC_FILE=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-tox | grep "TOXIC_FILE=" | head -n 1 | awk -F '=' '{print $2}')
TOXIC_FILE=$(cat /usr/local/bin/${PROJECT_NAME}-app-tox | grep "TOXIC_FILE=" | head -n 1 | awk -F '=' '{print $2}')
else
TOXIC_FILE=$(cat /usr/bin/${PROJECT_NAME}-app-tox | grep "TOXIC_FILE=" | head -n 1 | awk -F '=' '{print $2}')
fi
SECONDS=0 SECONDS=0
chroot "$rootdir" /root/$TEMP_SCRIPT_NAME chroot "$rootdir" /root/$TEMP_SCRIPT_NAME
@ -884,11 +852,7 @@ function mesh_tox_client {
function mesh_zeronet { function mesh_zeronet {
# obtain commits from the main file # obtain commits from the main file
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then ZERONET_COMMIT_MAIN=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
ZERONET_COMMIT_MAIN=$(cat /usr/local/bin/${PROJECT_NAME}-app-zeronet | grep "ZERONET_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
else
ZERONET_COMMIT_MAIN=$(cat /usr/bin/${PROJECT_NAME}-app-zeronet | grep "ZERONET_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
fi
if [ ${#ZERONET_COMMIT_MAIN} -gt 10 ]; then if [ ${#ZERONET_COMMIT_MAIN} -gt 10 ]; then
ZERONET_COMMIT=$ZERONET_COMMIT_MAIN ZERONET_COMMIT=$ZERONET_COMMIT_MAIN
fi fi
@ -897,11 +861,7 @@ function mesh_zeronet {
exit 37046 exit 37046
fi fi
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then ZERONET_REPO_MAIN=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_REPO=" | head -n 1 | awk -F '"' '{print $2}')
ZERONET_REPO_MAIN=$(cat /usr/local/bin/${PROJECT_NAME}-app-zeronet | grep "ZERONET_REPO=" | head -n 1 | awk -F '"' '{print $2}')
else
ZERONET_REPO_MAIN=$(cat /usr/bin/${PROJECT_NAME}-app-zeronet | grep "ZERONET_REPO=" | head -n 1 | awk -F '"' '{print $2}')
fi
if [ ${#ZERONET_REPO_MAIN} -gt 5 ]; then if [ ${#ZERONET_REPO_MAIN} -gt 5 ]; then
ZERONET_REPO=$ZERONET_REPO_MAIN ZERONET_REPO=$ZERONET_REPO_MAIN
fi fi
@ -910,11 +870,7 @@ function mesh_zeronet {
exit 37046 exit 37046
fi fi
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then ZERONET_PORT_MAIN=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_PORT=" | head -n 1 | awk -F '=' '{print $2}')
ZERONET_PORT_MAIN=$(cat /usr/local/bin/${PROJECT_NAME}-app-zeronet | grep "ZERONET_PORT=" | head -n 1 | awk -F '=' '{print $2}')
else
ZERONET_PORT_MAIN=$(cat /usr/bin/${PROJECT_NAME}-app-zeronet | grep "ZERONET_PORT=" | head -n 1 | awk -F '=' '{print $2}')
fi
if [ ${#ZERONET_PORT_MAIN} -gt 1 ]; then if [ ${#ZERONET_PORT_MAIN} -gt 1 ]; then
ZERONET_PORT=$ZERONET_PORT_MAIN ZERONET_PORT=$ZERONET_PORT_MAIN
fi fi
@ -995,13 +951,8 @@ function mesh_zeronet {
} }
function mesh_zeronet_blog { function mesh_zeronet_blog {
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then ZERONET_BLOG_REPO=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_BLOG_REPO=" | head -n 1 | awk -F '"' '{print $2}')
ZERONET_BLOG_REPO=$(cat /usr/local/bin/${PROJECT_NAME}-app-zeronet | grep "ZERONET_BLOG_REPO=" | head -n 1 | awk -F '"' '{print $2}') ZERONET_BLOG_COMMIT=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_BLOG_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
ZERONET_BLOG_COMMIT=$(cat /usr/local/bin/${PROJECT_NAME}-app-zeronet | grep "ZERONET_BLOG_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
else
ZERONET_BLOG_REPO=$(cat /usr/bin/${PROJECT_NAME}-app-zeronet | grep "ZERONET_BLOG_REPO=" | head -n 1 | awk -F '"' '{print $2}')
ZERONET_BLOG_COMMIT=$(cat /usr/bin/${PROJECT_NAME}-app-zeronet | grep "ZERONET_BLOG_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
fi
git clone $ZERONET_BLOG_REPO $rootdir$MESH_INSTALL_DIR/zeronet/ZeroBlog git clone $ZERONET_BLOG_REPO $rootdir$MESH_INSTALL_DIR/zeronet/ZeroBlog
if [ ! -d $rootdir$MESH_INSTALL_DIR/zeronet/ZeroBlog ]; then if [ ! -d $rootdir$MESH_INSTALL_DIR/zeronet/ZeroBlog ]; then
@ -1014,13 +965,8 @@ function mesh_zeronet_blog {
} }
function mesh_zeronet_mail { function mesh_zeronet_mail {
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then ZERONET_MAIL_REPO=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_MAIL_REPO=" | head -n 1 | awk -F '"' '{print $2}')
ZERONET_MAIL_REPO=$(cat /usr/local/bin/${PROJECT_NAME}-app-zeronet | grep "ZERONET_MAIL_REPO=" | head -n 1 | awk -F '"' '{print $2}') ZERONET_MAIL_COMMIT=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_MAIL_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
ZERONET_MAIL_COMMIT=$(cat /usr/local/bin/${PROJECT_NAME}-app-zeronet | grep "ZERONET_MAIL_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
else
ZERONET_MAIL_REPO=$(cat /usr/bin/${PROJECT_NAME}-app-zeronet | grep "ZERONET_MAIL_REPO=" | head -n 1 | awk -F '"' '{print $2}')
ZERONET_MAIL_COMMIT=$(cat /usr/bin/${PROJECT_NAME}-app-zeronet | grep "ZERONET_MAIL_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
fi
git clone $ZERONET_MAIL_REPO $rootdir$MESH_INSTALL_DIR/zeronet/ZeroMail git clone $ZERONET_MAIL_REPO $rootdir$MESH_INSTALL_DIR/zeronet/ZeroMail
if [ ! -d $rootdir$MESH_INSTALL_DIR/zeronet/ZeroMail ]; then if [ ! -d $rootdir$MESH_INSTALL_DIR/zeronet/ZeroMail ]; then
@ -1033,13 +979,8 @@ function mesh_zeronet_mail {
} }
function mesh_zeronet_forum { function mesh_zeronet_forum {
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then ZERONET_FORUM_REPO=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_FORUM_REPO=" | head -n 1 | awk -F '"' '{print $2}')
ZERONET_FORUM_REPO=$(cat /usr/local/bin/${PROJECT_NAME}-app-zeronet | grep "ZERONET_FORUM_REPO=" | head -n 1 | awk -F '"' '{print $2}') ZERONET_FORUM_COMMIT=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_FORUM_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
ZERONET_FORUM_COMMIT=$(cat /usr/local/bin/${PROJECT_NAME}-app-zeronet | grep "ZERONET_FORUM_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
else
ZERONET_FORUM_REPO=$(cat /usr/bin/${PROJECT_NAME}-app-zeronet | grep "ZERONET_FORUM_REPO=" | head -n 1 | awk -F '"' '{print $2}')
ZERONET_FORUM_COMMIT=$(cat /usr/bin/${PROJECT_NAME}-app-zeronet | grep "ZERONET_FORUM_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
fi
git clone $ZERONET_FORUM_REPO $rootdir$MESH_INSTALL_DIR/zeronet/ZeroTalk git clone $ZERONET_FORUM_REPO $rootdir$MESH_INSTALL_DIR/zeronet/ZeroTalk
if [ ! -d $rootdir$MESH_INSTALL_DIR/zeronet/ZeroTalk ]; then if [ ! -d $rootdir$MESH_INSTALL_DIR/zeronet/ZeroTalk ]; then
@ -1052,13 +993,8 @@ function mesh_zeronet_forum {
} }
function mesh_zeronet_id { function mesh_zeronet_id {
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then ZERONET_ID_REPO=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_ID_REPO=" | head -n 1 | awk -F '"' '{print $2}')
ZERONET_ID_REPO=$(cat /usr/local/bin/${PROJECT_NAME}-app-zeronet | grep "ZERONET_ID_REPO=" | head -n 1 | awk -F '"' '{print $2}') ZERONET_ID_COMMIT=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-zeronet | grep "ZERONET_ID_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
ZERONET_ID_COMMIT=$(cat /usr/local/bin/${PROJECT_NAME}-app-zeronet | grep "ZERONET_ID_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
else
ZERONET_ID_REPO=$(cat /usr/bin/${PROJECT_NAME}-app-zeronet | grep "ZERONET_ID_REPO=" | head -n 1 | awk -F '"' '{print $2}')
ZERONET_ID_COMMIT=$(cat /usr/bin/${PROJECT_NAME}-app-zeronet | grep "ZERONET_ID_COMMIT=" | head -n 1 | awk -F "'" '{print $2}')
fi
git clone $ZERONET_ID_REPO $rootdir$MESH_INSTALL_DIR/zeronet/ZeroID git clone $ZERONET_ID_REPO $rootdir$MESH_INSTALL_DIR/zeronet/ZeroID
if [ ! -d $rootdir$MESH_INSTALL_DIR/zeronet/ZeroID ]; then if [ ! -d $rootdir$MESH_INSTALL_DIR/zeronet/ZeroID ]; then

View File

@ -372,11 +372,7 @@ function configure_zeronet_id {
function configure_toxcore { function configure_toxcore {
echo $'Configuring toxcore' >> $INSTALL_LOG echo $'Configuring toxcore' >> $INSTALL_LOG
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then TOXIC_FILE=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-tox | grep "TOXIC_FILE=" | head -n 1 | awk -F '=' '{print $2}')
TOXIC_FILE=$(cat /usr/local/bin/${PROJECT_NAME}-app-tox | grep "TOXIC_FILE=" | head -n 1 | awk -F '=' '{print $2}')
else
TOXIC_FILE=$(cat /usr/bin/${PROJECT_NAME}-app-tox | grep "TOXIC_FILE=" | head -n 1 | awk -F '=' '{print $2}')
fi
echo $'Enabling toxcore daemon' >> $INSTALL_LOG echo $'Enabling toxcore daemon' >> $INSTALL_LOG
systemctl enable tox-bootstrapd.service systemctl enable tox-bootstrapd.service

View File

@ -36,11 +36,7 @@ export TEXTDOMAINDIR="/usr/share/locale"
CONFIG_FILE=$HOME/${PROJECT_NAME}.cfg CONFIG_FILE=$HOME/${PROJECT_NAME}.cfg
MUMBLE_PATH=/usr/bin/mumble MUMBLE_PATH=/usr/bin/mumble
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then TOXIC_FILE=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-tox | grep "TOXIC_FILE=" | head -n 1 | awk -F '=' '{print $2}')
TOXIC_FILE=$(cat /usr/local/bin/${PROJECT_NAME}-app-tox | grep "TOXIC_FILE=" | head -n 1 | awk -F '=' '{print $2}')
else
TOXIC_FILE=$(cat /usr/bin/${PROJECT_NAME}-app-tox | grep "TOXIC_FILE=" | head -n 1 | awk -F '=' '{print $2}')
fi
DHTNODES=/usr/share/toxic/DHTnodes DHTNODES=/usr/share/toxic/DHTnodes
PEERS_FILE=/tmp/meshpeers.txt PEERS_FILE=/tmp/meshpeers.txt

View File

@ -229,11 +229,7 @@ function mesh_avahi {
function install_babel_client { function install_babel_client {
# TODO to be fixed # TODO to be fixed
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then TOXIC_FILE=$(cat /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-tox | grep "TOXIC_FILE=" | head -n 1 | awk -F '=' '{print $2}')
TOXIC_FILE=$(cat /usr/local/bin/${PROJECT_NAME}-app-tox | grep "TOXIC_FILE=" | head -n 1 | awk -F '=' '{print $2}')
else
TOXIC_FILE=$(cat /usr/bin/${PROJECT_NAME}-app-tox | grep "TOXIC_FILE=" | head -n 1 | awk -F '=' '{print $2}')
fi
if [ ! -f ${rootdir}/tmp/meshtype ]; then if [ ! -f ${rootdir}/tmp/meshtype ]; then
$CHROOT_PREFIX sudo apt-get -y install babeld $CHROOT_PREFIX sudo apt-get -y install babeld

View File

@ -79,6 +79,8 @@ function detect_apps {
APPS_CHOSEN+=("0") APPS_CHOSEN+=("0")
fi fi
done done
function_check get_apps_installed
get_apps_installed get_apps_installed
} }
@ -112,6 +114,8 @@ function choose_apps_for_variant {
fi fi
done done
function_check get_apps_installed
get_apps_installed get_apps_installed
} }

View File

@ -235,6 +235,13 @@ function remove_default_user {
fi fi
} }
function upgrade_installation {
if [ ! -d /usr/share/${PROJECT_NAME}/apps ]; then
mkdir -p /usr/share/${PROJECT_NAME}/apps
fi
mv /usr/local/bin/${PROJECT_NAME}-app-* /usr/share/${PROJECT_NAME}/apps
}
function setup_firewall { function setup_firewall {
configure_firewall configure_firewall
configure_firewall_ping configure_firewall_ping
@ -244,6 +251,7 @@ function setup_firewall {
function setup_utils { function setup_utils {
read_configuration read_configuration
upgrade_installation
set_default_onion_domains set_default_onion_domains
locale_setup locale_setup
parse_args parse_args