Move utils into the share directory

This commit is contained in:
Bob Mottram 2016-07-06 20:27:18 +01:00
parent c4abe22744
commit 2bb77bcf1b
16 changed files with 20 additions and 87 deletions

View File

@ -17,6 +17,7 @@ source:
install: install:
mkdir -p ${DESTDIR}${PREFIX}/bin mkdir -p ${DESTDIR}${PREFIX}/bin
mkdir -p ${DESTDIR}/usr/share/${APP}/apps mkdir -p ${DESTDIR}/usr/share/${APP}/apps
mkdir -p ${DESTDIR}/usr/share/${APP}/utils
mkdir -p ${DESTDIR}/etc/${APP} mkdir -p ${DESTDIR}/etc/${APP}
cp -r image_build/* ${DESTDIR}/etc/${APP} cp -r image_build/* ${DESTDIR}/etc/${APP}
install -m 755 img/backgrounds/${APP}_mesh_background.png ${DESTDIR}${PREFIX}/share install -m 755 img/backgrounds/${APP}_mesh_background.png ${DESTDIR}${PREFIX}/share
@ -29,6 +30,7 @@ install:
install -m 755 src/${APP}-restore-local ${DESTDIR}${PREFIX}/bin/restore install -m 755 src/${APP}-restore-local ${DESTDIR}${PREFIX}/bin/restore
install -m 755 src/${APP}-restore-remote ${DESTDIR}${PREFIX}/bin/restorefromfriend install -m 755 src/${APP}-restore-remote ${DESTDIR}${PREFIX}/bin/restorefromfriend
mv ${DESTDIR}${PREFIX}/bin/${APP}-app-* ${DESTDIR}/usr/share/${APP}/apps mv ${DESTDIR}${PREFIX}/bin/${APP}-app-* ${DESTDIR}/usr/share/${APP}/apps
mv ${DESTDIR}${PREFIX}/bin/${APP}-utils-* ${DESTDIR}/usr/share/${APP}/utils
mkdir -m 755 -p ${DESTDIR}${PREFIX}/share/man/man1 mkdir -m 755 -p ${DESTDIR}${PREFIX}/share/man/man1
install -m 644 man/*.1.gz ${DESTDIR}${PREFIX}/share/man/man1 install -m 644 man/*.1.gz ${DESTDIR}${PREFIX}/share/man/man1
install -m 644 man/${APP}-backup-local.1.gz ${DESTDIR}${PREFIX}/share/man/man1/backup.1.gz install -m 644 man/${APP}-backup-local.1.gz ${DESTDIR}${PREFIX}/share/man/man1/backup.1.gz

View File

@ -36,10 +36,7 @@ export TEXTDOMAINDIR="/usr/share/locale"
CONFIGURATION_FILE=$HOME/${PROJECT_NAME}.cfg CONFIGURATION_FILE=$HOME/${PROJECT_NAME}.cfg
COMPLETION_FILE=$HOME/${PROJECT_NAME}-completed.txt COMPLETION_FILE=$HOME/${PROJECT_NAME}-completed.txt
source /usr/local/bin/${PROJECT_NAME}-utils-git source /usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-git
if [ -f /usr/bin/${PROJECT_NAME}-utils-git ]; then
source /usr/bin/${PROJECT_NAME}-utils-git
fi
HOSTNAME= HOSTNAME=
LETSENCRYPT_HOSTNAME= LETSENCRYPT_HOSTNAME=

View File

@ -62,14 +62,7 @@ if [ ! -f $COMPLETION_FILE ]; then
fi fi
# Minimum number of characters in a password # Minimum number of characters in a password
MINIMUM_PASSWORD_LENGTH=10 MINIMUM_PASSWORD_LENGTH=$(cat /usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-passwords | grep 'MINIMUM_PASSWORD_LENGTH=' | head -n 1 | awk -F '=' '{print $2}')
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then
MINIMUM_PASSWORD_LENGTH=$(cat /usr/local/bin/${PROJECT_NAME}-utils-passwords | grep 'MINIMUM_PASSWORD_LENGTH=' | head -n 1 | awk -F '=' '{print $2}')
else
if [ -f /usr/bin/${PROJECT_NAME} ]; then
MINIMUM_PASSWORD_LENGTH=$(cat /usr/bin/${PROJECT_NAME}-utils-passwords | grep 'MINIMUM_PASSWORD_LENGTH=' | head -n 1 | awk -F '=' '{print $2}')
fi
fi
NEW_USER_PASSWORD="$(openssl rand -base64 30 | cut -c1-${MINIMUM_PASSWORD_LENGTH})" NEW_USER_PASSWORD="$(openssl rand -base64 30 | cut -c1-${MINIMUM_PASSWORD_LENGTH})"
useradd -m -p "$NEW_USER_PASSWORD" -s /bin/bash $MY_USERNAME useradd -m -p "$NEW_USER_PASSWORD" -s /bin/bash $MY_USERNAME

View File

@ -48,13 +48,8 @@ if [ -f $CONFIG_FILE ]; then
fi fi
# get the version of Go being used # get the version of Go being used
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then GO_VERSION=$(cat /usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-go | grep 'GO_VERSION=' | head -n 1 | awk -F '=' '{print $2}')
GO_VERSION=$(cat /usr/local/bin/${PROJECT_NAME}-utils-go | grep 'GO_VERSION=' | head -n 1 | awk -F '=' '{print $2}') GVM_HOME=$(cat /usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-go | grep 'GVM_HOME=' | head -n 1 | awk -F '=' '{print $2}')
GVM_HOME=$(cat /usr/local/bin/${PROJECT_NAME}-utils-go | grep 'GVM_HOME=' | head -n 1 | awk -F '=' '{print $2}')
else
GO_VERSION=$(cat /usr/bin/${PROJECT_NAME}-utils-go | grep 'GO_VERSION=' | head -n 1 | awk -F '=' '{print $2}')
GVM_HOME=$(cat /usr/bin/${PROJECT_NAME}-utils-go | grep 'GVM_HOME=' | head -n 1 | awk -F '=' '{print $2}')
fi
ADMIN_USERNAME= ADMIN_USERNAME=
ADMIN_NAME= ADMIN_NAME=

View File

@ -41,11 +41,7 @@ export TEXTDOMAINDIR="/usr/share/locale"
SERVER_DIRECTORY=/root/remotebackup SERVER_DIRECTORY=/root/remotebackup
# get the version of Go being used # get the version of Go being used
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then GO_VERSION=$(cat /usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-go | grep 'GO_VERSION=' | head -n 1 | awk -F '=' '{print $2}')
GO_VERSION=$(cat /usr/local/bin/${PROJECT_NAME}-utils-go | grep 'GO_VERSION=' | head -n 1 | awk -F '=' '{print $2}')
else
GO_VERSION=$(cat /usr/bin/${PROJECT_NAME}-utils-go | grep 'GO_VERSION=' | head -n 1 | awk -F '=' '{print $2}')
fi
ADMIN_USERNAME=$(cat $COMPLETION_FILE | grep "Admin user" | awk -F ':' '{print $2}') ADMIN_USERNAME=$(cat $COMPLETION_FILE | grep "Admin user" | awk -F ':' '{print $2}')
ADMIN_NAME=$(getent passwd $ADMIN_USERNAME | cut -d: -f5 | cut -d, -f1) ADMIN_NAME=$(getent passwd $ADMIN_USERNAME | cut -d: -f5 | cut -d, -f1)

View File

@ -43,14 +43,7 @@ export TEXTDOMAINDIR="/usr/share/locale"
FREEDOMBONE_WEBSITE="http://freedombone.uk.to" FREEDOMBONE_WEBSITE="http://freedombone.uk.to"
# Minimum number of characters in a password # Minimum number of characters in a password
MINIMUM_PASSWORD_LENGTH=10 MINIMUM_PASSWORD_LENGTH=$(cat /usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-passwords | grep 'MINIMUM_PASSWORD_LENGTH=' | head -n 1 | awk -F '=' '{print $2}')
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then
MINIMUM_PASSWORD_LENGTH=$(cat /usr/local/bin/${PROJECT_NAME}-utils-passwords | grep 'MINIMUM_PASSWORD_LENGTH=' | head -n 1 | awk -F '=' '{print $2}')
else
if [ -f /usr/bin/${PROJECT_NAME} ]; then
MINIMUM_PASSWORD_LENGTH=$(cat /usr/bin/${PROJECT_NAME}-utils-passwords | grep 'MINIMUM_PASSWORD_LENGTH=' | head -n 1 | awk -F '=' '{print $2}')
fi
fi
# file containing new password # file containing new password
IMAGE_PASSWORD_FILE=/root/login.txt IMAGE_PASSWORD_FILE=/root/login.txt

View File

@ -41,14 +41,7 @@ UPGRADE_SCRIPT_NAME="${PROJECT_NAME}-upgrade"
UPDATE_DATE_SCRIPT=/usr/bin/updatedate UPDATE_DATE_SCRIPT=/usr/bin/updatedate
# Minimum number of characters in a password # Minimum number of characters in a password
MINIMUM_PASSWORD_LENGTH=10 MINIMUM_PASSWORD_LENGTH=$(cat /usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-passwords | grep 'MINIMUM_PASSWORD_LENGTH=' | head -n 1 | awk -F '=' '{print $2}')
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then
MINIMUM_PASSWORD_LENGTH=$(cat /usr/local/bin/${PROJECT_NAME}-utils-passwords | grep 'MINIMUM_PASSWORD_LENGTH=' | head -n 1 | awk -F '=' '{print $2}')
else
if [ -f /usr/bin/${PROJECT_NAME} ]; then
MINIMUM_PASSWORD_LENGTH=$(cat /usr/bin/${PROJECT_NAME}-utils-passwords | grep 'MINIMUM_PASSWORD_LENGTH=' | head -n 1 | awk -F '=' '{print $2}')
fi
fi
# voip # voip
VOIP_PORT=64738 VOIP_PORT=64738

View File

@ -76,14 +76,7 @@ CONFIG_FILENAME=
DEFAULT_DOMAIN_NAME="${PROJECT_NAME}.local" DEFAULT_DOMAIN_NAME="${PROJECT_NAME}.local"
# Minimum number of characters in a password # Minimum number of characters in a password
MINIMUM_PASSWORD_LENGTH=10 MINIMUM_PASSWORD_LENGTH=$(cat /usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-passwords | grep 'MINIMUM_PASSWORD_LENGTH=' | head -n 1 | awk -F '=' '{print $2}')
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then
MINIMUM_PASSWORD_LENGTH=$(cat /usr/local/bin/${PROJECT_NAME}-utils-passwords | grep 'MINIMUM_PASSWORD_LENGTH=' | head -n 1 | awk -F '=' '{print $2}')
else
if [ -f /usr/bin/${PROJECT_NAME} ]; then
MINIMUM_PASSWORD_LENGTH=$(cat /usr/bin/${PROJECT_NAME}-utils-passwords | grep 'MINIMUM_PASSWORD_LENGTH=' | head -n 1 | awk -F '=' '{print $2}')
fi
fi
# Optional ssh public key to allow # Optional ssh public key to allow
SSH_PUBKEY="no" SSH_PUBKEY="no"

View File

@ -79,10 +79,7 @@ MESH_INSTALL_DIR=/var/lib
REMOVE='no' REMOVE='no'
source /usr/local/bin/${PROJECT_NAME}-utils-git source /usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-git
if [ -f /usr/bin/${PROJECT_NAME}-utils-git ]; then
source /usr/bin/${PROJECT_NAME}-utils-git
fi
function show_help { function show_help {
echo '' echo ''

View File

@ -34,14 +34,7 @@ export TEXTDOMAIN=${PROJECT_NAME}-mirrors
export TEXTDOMAINDIR="/usr/share/locale" export TEXTDOMAINDIR="/usr/share/locale"
# Minimum number of characters in a password # Minimum number of characters in a password
MINIMUM_PASSWORD_LENGTH=10 MINIMUM_PASSWORD_LENGTH=$(cat /usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-passwords | grep 'MINIMUM_PASSWORD_LENGTH=' | head -n 1 | awk -F '=' '{print $2}')
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then
MINIMUM_PASSWORD_LENGTH=$(cat /usr/local/bin/${PROJECT_NAME}-utils-passwords | grep 'MINIMUM_PASSWORD_LENGTH=' | head -n 1 | awk -F '=' '{print $2}')
else
if [ -f /usr/bin/${PROJECT_NAME} ]; then
MINIMUM_PASSWORD_LENGTH=$(cat /usr/bin/${PROJECT_NAME}-utils-passwords | grep 'MINIMUM_PASSWORD_LENGTH=' | head -n 1 | awk -F '=' '{print $2}')
fi
fi
CONFIGURATION_FILE="/root/${PROJECT_NAME}.cfg" CONFIGURATION_FILE="/root/${PROJECT_NAME}.cfg"
@ -58,7 +51,7 @@ if [ ! -f $MAIN_COMMAND ]; then
MAIN_COMMAND=/usr/bin/${PROJECT_NAME} MAIN_COMMAND=/usr/bin/${PROJECT_NAME}
fi fi
REPOS=($(cat ${MAIN_COMMAND} ${MAIN_COMMAND}-utils-* /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-* | grep "_REPO=\"" | uniq -u | sed 's|${PROJECT_NAME}|'"${PROJECT_NAME}"'|g')) REPOS=($(cat ${MAIN_COMMAND} /usr/share/${PROJECT_NAME}/utils/${MAIN_COMMAND}-utils-* /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-* | grep "_REPO=\"" | uniq -u | sed 's|${PROJECT_NAME}|'"${PROJECT_NAME}"'|g'))
# obtain the mirrors password if it exists # obtain the mirrors password if it exists

View File

@ -44,14 +44,7 @@ MY_USERNAME=$USER
FRIENDS_SERVERS_LIST= FRIENDS_SERVERS_LIST=
# Minimum password length in characters # Minimum password length in characters
MINIMUM_PASSWORD_LENGTH=10 MINIMUM_PASSWORD_LENGTH=$(cat /usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-passwords | grep 'MINIMUM_PASSWORD_LENGTH=' | head -n 1 | awk -F '=' '{print $2}')
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then
MINIMUM_PASSWORD_LENGTH=$(cat /usr/local/bin/${PROJECT_NAME}-utils-passwords | grep 'MINIMUM_PASSWORD_LENGTH=' | head -n 1 | awk -F '=' '{print $2}')
else
if [ -f /usr/bin/${PROJECT_NAME} ]; then
MINIMUM_PASSWORD_LENGTH=$(cat /usr/bin/${PROJECT_NAME}-utils-passwords | grep 'MINIMUM_PASSWORD_LENGTH=' | head -n 1 | awk -F '=' '{print $2}')
fi
fi
# How many remote locations were specified # How many remote locations were specified
entering_remote_backups_ctr=0 entering_remote_backups_ctr=0

View File

@ -50,13 +50,8 @@ if [ -f $CONFIG_FILE ]; then
fi fi
# get the version of Go being used # get the version of Go being used
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then GO_VERSION=$(cat /usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-go | grep 'GO_VERSION=' | head -n 1 | awk -F '=' '{print $2}')
GO_VERSION=$(cat /usr/local/bin/${PROJECT_NAME}-utils-go | grep 'GO_VERSION=' | head -n 1 | awk -F '=' '{print $2}') GVM_HOME=$(cat /usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-go | grep 'GVM_HOME=' | head -n 1 | awk -F '=' '{print $2}')
GVM_HOME=$(cat /usr/local/bin/${PROJECT_NAME}-utils-go | grep 'GVM_HOME=' | head -n 1 | awk -F '=' '{print $2}')
else
GO_VERSION=$(cat /usr/bin/${PROJECT_NAME}-utils-go | grep 'GO_VERSION=' | head -n 1 | awk -F '=' '{print $2}')
GVM_HOME=$(cat /usr/bin/${PROJECT_NAME}-utils-go | grep 'GVM_HOME=' | head -n 1 | awk -F '=' '{print $2}')
fi
ADMIN_USERNAME= ADMIN_USERNAME=
ADMIN_NAME= ADMIN_NAME=

View File

@ -88,11 +88,7 @@ else
fi fi
# get the version of Go being used # get the version of Go being used
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then GO_VERSION=$(cat /usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-go | grep 'GO_VERSION=' | head -n 1 | awk -F '=' '{print $2}')
GO_VERSION=$(cat /usr/local/bin/${PROJECT_NAME}-utils-go | grep 'GO_VERSION=' | head -n 1 | awk -F '=' '{print $2}')
else
GO_VERSION=$(cat /usr/bin/${PROJECT_NAME}-utils-go | grep 'GO_VERSION=' | head -n 1 | awk -F '=' '{print $2}')
fi
# MariaDB password # MariaDB password
DATABASE_PASSWORD=$(cat /root/dbpass) DATABASE_PASSWORD=$(cat /root/dbpass)

View File

@ -42,7 +42,7 @@ source $PROJECT_INSTALL_DIR/${PROJECT_NAME}-vars
COMPLETION_FILE=$HOME/${PROJECT_NAME}-completed.txt COMPLETION_FILE=$HOME/${PROJECT_NAME}-completed.txt
source $PROJECT_INSTALL_DIR/${PROJECT_NAME}-utils-selector source /usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-selector
function show_apps { function show_apps {
applist="" applist=""

View File

@ -42,10 +42,7 @@ FRIENDS_MIRRORS_SSH_PORT=2222
FRIENDS_MIRRORS_PASSWORD= FRIENDS_MIRRORS_PASSWORD=
MY_MIRRORS_PASSWORD= MY_MIRRORS_PASSWORD=
source /usr/local/bin/${PROJECT_NAME}-utils-git source /usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-git
if [ -f /usr/bin/${PROJECT_NAME}-utils-git ]; then
source /usr/bin/${PROJECT_NAME}-utils-git
fi
function read_repo_servers { function read_repo_servers {
if [ -f $CONFIGURATION_FILE ]; then if [ -f $CONFIGURATION_FILE ]; then

View File

@ -74,7 +74,7 @@ DEBIAN_VERSION="jessie"
ENABLE_SOCIAL_KEY_MANAGEMENT="no" ENABLE_SOCIAL_KEY_MANAGEMENT="no"
# include utils # include utils
UTILS_FILES=$PROJECT_INSTALL_DIR/${PROJECT_NAME}-utils-* UTILS_FILES=/usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-*
for f in $UTILS_FILES for f in $UTILS_FILES
do do
source $f source $f