2024-08-03 17:04:51 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2024-08-24 17:23:45 +02:00
|
|
|
# Need doas to work.
|
|
|
|
|
2024-08-03 17:04:51 +02:00
|
|
|
cd "$( dirname "$( readlink -f "$0" )" )" || exit
|
|
|
|
|
|
|
|
CONFIG_PATH="./config"
|
|
|
|
|
2024-08-24 17:23:45 +02:00
|
|
|
. ${CONFIG_PATH}/*.conf
|
2024-08-03 17:04:51 +02:00
|
|
|
|
2024-08-24 17:50:37 +02:00
|
|
|
#echo "$_GIT_FOLDER"
|
|
|
|
#echo "$_INSTRUCTIONS"
|
2024-08-03 17:04:51 +02:00
|
|
|
|
2024-08-27 11:55:43 +02:00
|
|
|
function deploy {
|
|
|
|
|
|
|
|
while VAR= read -r line;
|
|
|
|
do
|
|
|
|
order="$(echo $line | cut -d ' ' -f 1)"
|
|
|
|
operand_1="$(echo $line | cut -d ' ' -f 2)"
|
|
|
|
operand_2="$(echo $line | cut -d ' ' -f 3)"
|
|
|
|
|
|
|
|
if [ "$order" = "du" ]
|
|
|
|
then
|
|
|
|
cp -Rf ${_GIT_FOLDER}/${operand_2}/* ${operand_1}
|
|
|
|
elif [ "$order" = "fu" ]
|
|
|
|
then
|
|
|
|
install -Dm644 ${_GIT_FOLDER}/${operand_2} ${operand_1}
|
|
|
|
elif [ "$order" = "dr" ]
|
|
|
|
then
|
|
|
|
doas cp -Rf ${_GIT_FOLDER}/${operand_2}/* ${operand_1}
|
|
|
|
elif [ "$order" = "fr" ]
|
|
|
|
then
|
|
|
|
doas install -Dm644 ${_GIT_FOLDER}/${operand_2} ${operand_1}
|
|
|
|
elif [ "$order" = "uu" ]
|
|
|
|
then
|
|
|
|
cd "${_GIT_FOLDER}/${operand_1}"
|
|
|
|
git pull
|
|
|
|
cd -
|
|
|
|
else
|
|
|
|
echo "Err, $order uknown"
|
|
|
|
echo ".. ${order} ${operand_1} ${operand_2} ..";
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
done <<< "$_INSTRUCTIONS"
|
|
|
|
}
|
|
|
|
|
|
|
|
deploy
|