Move utils into the share directory
This commit is contained in:
parent
c4abe22744
commit
2bb77bcf1b
2
Makefile
2
Makefile
|
@ -17,6 +17,7 @@ source:
|
|||
install:
|
||||
mkdir -p ${DESTDIR}${PREFIX}/bin
|
||||
mkdir -p ${DESTDIR}/usr/share/${APP}/apps
|
||||
mkdir -p ${DESTDIR}/usr/share/${APP}/utils
|
||||
mkdir -p ${DESTDIR}/etc/${APP}
|
||||
cp -r image_build/* ${DESTDIR}/etc/${APP}
|
||||
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-remote ${DESTDIR}${PREFIX}/bin/restorefromfriend
|
||||
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
|
||||
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
|
||||
|
|
|
@ -36,10 +36,7 @@ export TEXTDOMAINDIR="/usr/share/locale"
|
|||
CONFIGURATION_FILE=$HOME/${PROJECT_NAME}.cfg
|
||||
COMPLETION_FILE=$HOME/${PROJECT_NAME}-completed.txt
|
||||
|
||||
source /usr/local/bin/${PROJECT_NAME}-utils-git
|
||||
if [ -f /usr/bin/${PROJECT_NAME}-utils-git ]; then
|
||||
source /usr/bin/${PROJECT_NAME}-utils-git
|
||||
fi
|
||||
source /usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-git
|
||||
|
||||
HOSTNAME=
|
||||
LETSENCRYPT_HOSTNAME=
|
||||
|
|
|
@ -62,14 +62,7 @@ if [ ! -f $COMPLETION_FILE ]; then
|
|||
fi
|
||||
|
||||
# Minimum number of characters in a password
|
||||
MINIMUM_PASSWORD_LENGTH=10
|
||||
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
|
||||
MINIMUM_PASSWORD_LENGTH=$(cat /usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-passwords | grep 'MINIMUM_PASSWORD_LENGTH=' | head -n 1 | awk -F '=' '{print $2}')
|
||||
|
||||
NEW_USER_PASSWORD="$(openssl rand -base64 30 | cut -c1-${MINIMUM_PASSWORD_LENGTH})"
|
||||
useradd -m -p "$NEW_USER_PASSWORD" -s /bin/bash $MY_USERNAME
|
||||
|
|
|
@ -48,13 +48,8 @@ if [ -f $CONFIG_FILE ]; then
|
|||
fi
|
||||
|
||||
# get the version of Go being used
|
||||
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then
|
||||
GO_VERSION=$(cat /usr/local/bin/${PROJECT_NAME}-utils-go | grep 'GO_VERSION=' | 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
|
||||
GO_VERSION=$(cat /usr/share/${PROJECT_NAME}/utils/${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}')
|
||||
|
||||
ADMIN_USERNAME=
|
||||
ADMIN_NAME=
|
||||
|
|
|
@ -41,11 +41,7 @@ export TEXTDOMAINDIR="/usr/share/locale"
|
|||
SERVER_DIRECTORY=/root/remotebackup
|
||||
|
||||
# get the version of Go being used
|
||||
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then
|
||||
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
|
||||
GO_VERSION=$(cat /usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-go | grep 'GO_VERSION=' | head -n 1 | 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)
|
||||
|
|
|
@ -43,14 +43,7 @@ export TEXTDOMAINDIR="/usr/share/locale"
|
|||
FREEDOMBONE_WEBSITE="http://freedombone.uk.to"
|
||||
|
||||
# Minimum number of characters in a password
|
||||
MINIMUM_PASSWORD_LENGTH=10
|
||||
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
|
||||
MINIMUM_PASSWORD_LENGTH=$(cat /usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-passwords | grep 'MINIMUM_PASSWORD_LENGTH=' | head -n 1 | awk -F '=' '{print $2}')
|
||||
|
||||
# file containing new password
|
||||
IMAGE_PASSWORD_FILE=/root/login.txt
|
||||
|
|
|
@ -41,14 +41,7 @@ UPGRADE_SCRIPT_NAME="${PROJECT_NAME}-upgrade"
|
|||
UPDATE_DATE_SCRIPT=/usr/bin/updatedate
|
||||
|
||||
# Minimum number of characters in a password
|
||||
MINIMUM_PASSWORD_LENGTH=10
|
||||
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
|
||||
MINIMUM_PASSWORD_LENGTH=$(cat /usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-passwords | grep 'MINIMUM_PASSWORD_LENGTH=' | head -n 1 | awk -F '=' '{print $2}')
|
||||
|
||||
# voip
|
||||
VOIP_PORT=64738
|
||||
|
|
|
@ -76,14 +76,7 @@ CONFIG_FILENAME=
|
|||
DEFAULT_DOMAIN_NAME="${PROJECT_NAME}.local"
|
||||
|
||||
# Minimum number of characters in a password
|
||||
MINIMUM_PASSWORD_LENGTH=10
|
||||
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
|
||||
MINIMUM_PASSWORD_LENGTH=$(cat /usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-passwords | grep 'MINIMUM_PASSWORD_LENGTH=' | head -n 1 | awk -F '=' '{print $2}')
|
||||
|
||||
# Optional ssh public key to allow
|
||||
SSH_PUBKEY="no"
|
||||
|
|
|
@ -79,10 +79,7 @@ MESH_INSTALL_DIR=/var/lib
|
|||
|
||||
REMOVE='no'
|
||||
|
||||
source /usr/local/bin/${PROJECT_NAME}-utils-git
|
||||
if [ -f /usr/bin/${PROJECT_NAME}-utils-git ]; then
|
||||
source /usr/bin/${PROJECT_NAME}-utils-git
|
||||
fi
|
||||
source /usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-git
|
||||
|
||||
function show_help {
|
||||
echo ''
|
||||
|
|
|
@ -34,14 +34,7 @@ export TEXTDOMAIN=${PROJECT_NAME}-mirrors
|
|||
export TEXTDOMAINDIR="/usr/share/locale"
|
||||
|
||||
# Minimum number of characters in a password
|
||||
MINIMUM_PASSWORD_LENGTH=10
|
||||
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
|
||||
MINIMUM_PASSWORD_LENGTH=$(cat /usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-passwords | grep 'MINIMUM_PASSWORD_LENGTH=' | head -n 1 | awk -F '=' '{print $2}')
|
||||
|
||||
CONFIGURATION_FILE="/root/${PROJECT_NAME}.cfg"
|
||||
|
||||
|
@ -58,7 +51,7 @@ if [ ! -f $MAIN_COMMAND ]; then
|
|||
MAIN_COMMAND=/usr/bin/${PROJECT_NAME}
|
||||
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
|
||||
|
|
|
@ -44,14 +44,7 @@ MY_USERNAME=$USER
|
|||
FRIENDS_SERVERS_LIST=
|
||||
|
||||
# Minimum password length in characters
|
||||
MINIMUM_PASSWORD_LENGTH=10
|
||||
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
|
||||
MINIMUM_PASSWORD_LENGTH=$(cat /usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-passwords | grep 'MINIMUM_PASSWORD_LENGTH=' | head -n 1 | awk -F '=' '{print $2}')
|
||||
|
||||
# How many remote locations were specified
|
||||
entering_remote_backups_ctr=0
|
||||
|
|
|
@ -50,13 +50,8 @@ if [ -f $CONFIG_FILE ]; then
|
|||
fi
|
||||
|
||||
# get the version of Go being used
|
||||
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then
|
||||
GO_VERSION=$(cat /usr/local/bin/${PROJECT_NAME}-utils-go | grep 'GO_VERSION=' | 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
|
||||
GO_VERSION=$(cat /usr/share/${PROJECT_NAME}/utils/${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}')
|
||||
|
||||
ADMIN_USERNAME=
|
||||
ADMIN_NAME=
|
||||
|
|
|
@ -88,11 +88,7 @@ else
|
|||
fi
|
||||
|
||||
# get the version of Go being used
|
||||
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then
|
||||
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
|
||||
GO_VERSION=$(cat /usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-go | grep 'GO_VERSION=' | head -n 1 | awk -F '=' '{print $2}')
|
||||
|
||||
# MariaDB password
|
||||
DATABASE_PASSWORD=$(cat /root/dbpass)
|
||||
|
|
|
@ -42,7 +42,7 @@ source $PROJECT_INSTALL_DIR/${PROJECT_NAME}-vars
|
|||
|
||||
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 {
|
||||
applist=""
|
||||
|
|
|
@ -42,10 +42,7 @@ FRIENDS_MIRRORS_SSH_PORT=2222
|
|||
FRIENDS_MIRRORS_PASSWORD=
|
||||
MY_MIRRORS_PASSWORD=
|
||||
|
||||
source /usr/local/bin/${PROJECT_NAME}-utils-git
|
||||
if [ -f /usr/bin/${PROJECT_NAME}-utils-git ]; then
|
||||
source /usr/bin/${PROJECT_NAME}-utils-git
|
||||
fi
|
||||
source /usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-git
|
||||
|
||||
function read_repo_servers {
|
||||
if [ -f $CONFIGURATION_FILE ]; then
|
||||
|
|
|
@ -74,7 +74,7 @@ DEBIAN_VERSION="jessie"
|
|||
ENABLE_SOCIAL_KEY_MANAGEMENT="no"
|
||||
|
||||
# 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
|
||||
do
|
||||
source $f
|
||||
|
|
Loading…
Reference in New Issue