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:23:45 +02:00
|
|
|
echo "$_GIT_FOLDER"
|
|
|
|
echo "$_INSTRUCTIONS"
|
2024-08-03 17:04:51 +02:00
|
|
|
|
|
|
|
while VAR= read -r line;
|
|
|
|
do
|
2024-08-03 17:15:10 +02:00
|
|
|
order="$(echo $line | cut -d ' ' -f 1)"
|
2024-08-24 17:23:45 +02:00
|
|
|
operand_1="$(echo $line | cut -d ' ' -f 2)"
|
|
|
|
operand_2="$(echo $line | cut -d ' ' -f 3)"
|
2024-08-03 17:15:10 +02:00
|
|
|
|
|
|
|
if [ "$order" = "d" ]
|
|
|
|
then
|
|
|
|
echo ".. d detected .."
|
2024-08-24 17:23:45 +02:00
|
|
|
echo "cp -Rf ${_GIT_FOLDER}/${operand_2} ${operand_1}"
|
2024-08-03 17:15:10 +02:00
|
|
|
elif [ "$order" = "f" ]
|
|
|
|
then
|
|
|
|
echo ".. f detected .."
|
2024-08-24 17:23:45 +02:00
|
|
|
elif [ "$order" = "u" ]
|
|
|
|
then
|
|
|
|
cd "${_GIT_FOLDER}/${operand_1}"
|
|
|
|
git pull
|
|
|
|
cd -
|
2024-08-03 17:15:10 +02:00
|
|
|
else
|
|
|
|
echo "Err, $order uknown"
|
|
|
|
fi
|
|
|
|
|
2024-08-24 17:23:45 +02:00
|
|
|
echo ".. ${order} ${operand_1} ${operand_2} ..";
|
2024-08-03 17:15:10 +02:00
|
|
|
|
2024-08-24 17:23:45 +02:00
|
|
|
done <<< "$_INSTRUCTIONS"
|