forked from project-trident/trident-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-local.sh
executable file
·34 lines (31 loc) · 1012 Bytes
/
install-local.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh
#Quick Script for installing core files on the local system
###########################
# INPUTS:
# $1: path to installation directory (optional - only use when preparing to make a package)
# $2: Package files to install ([something]-files directory tree). This can be a list of multiple package files
# Example: "core" will install everything under the "core-files" directory structure
###########################
install_dir="$1"
install_files="$2"
#validate the inputs
if [ -z "${install_dir}" ] ; then
install_dir="/"
fi
if [ -z "${install_files}" ] ; then
install_files="core"
fi
#Make sure the install directory exists
if [ ! -d "${install_dir}" ] ; then
#Create the install dir first
mkdir -p "${install_dir}"
chmod 755 "${install_dir}"
fi
# Start installing the files
echo "Copying Files to: ${install_dir}"
for files in ${install_files}
do
echo " - Copy Package Files: ${files}"
cp -r --preserve=mode ${files}-files/* "${install_dir}/."
done
echo "Done"