44 lines
1.2 KiB
Bash
Executable File
44 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
# ------------------------------------------------------------------------------
|
|
# That script is used to create an archive for init.sh deployment
|
|
# This file is part of the init.sh project
|
|
# Copyright (c) 2019-2021 Geoffray Levasseur <fatalerrors@geoffray-levasseur.org>
|
|
# ------------------------------------------------------------------------------
|
|
# This file is distributed under 3-clause BSD license.
|
|
# The complete license agreement can be obtained at:
|
|
# https://opensource.org/licenses/BSD-3-Clause
|
|
# ------------------------------------------------------------------------------
|
|
|
|
VERSION=$(grep "VERSION=" init.sh | cut -d'=' -f 2 | sed s/\"//g)
|
|
TMPDIR="/tmp/init-$VERSION"
|
|
CWD=$(pwd)
|
|
|
|
mkdir -pv $TMPDIR
|
|
|
|
echo
|
|
echo "***"
|
|
echo "*** Copying files..."
|
|
echo "***"
|
|
cp -av conf doc init.sh lib LICENSE modules README.* repo $TMPDIR
|
|
|
|
cd $(dirname $TMPDIR)
|
|
echo
|
|
echo "***"
|
|
echo "*** Creating archive..."
|
|
echo "***"
|
|
tar --gzip -cvf $CWD/init.sh-$VERSION.tar.gz $(basename $TMPDIR)
|
|
|
|
cd $CWD
|
|
echo
|
|
echo "***"
|
|
echo "*** Removing temporary files..."
|
|
echo "***"
|
|
rm -rfv $TMPDIR
|
|
|
|
echo
|
|
echo "***"
|
|
echo "*** Done."
|
|
echo "***"
|
|
echo
|
|
echo "Archive init.sh-$VERSION.tar.gz was created succesfully in working directory."
|