kaido/src/commands/update.sh
2025-08-16 00:48:31 +02:00

30 lines
536 B
Bash
Executable File

#!/bin/bash
#TODO check repository persmissions for both kaido and config
#TODO replace confdir with KAIDO_CONFIG_FOLDER
source /opt/kaido/src/libs/bash/lib.sh
# variables
root="/opt/kaido"
sysConfigDir="/etc/kaido"
configDir="$KAIDO_CONFIG_FOLDER"
# ----------
# kaido repository
cd $root
sudo git reset --hard
sudo git pull
if [ -d "$sysConfigDir" ]; then
cd /etc/kaido
sudo git reset --hard
sudo git pull
fi
if [ ! "$configDir" = "$sysConfigDir" ]; then
cd $configDir
git reset --hard
git pull
fi
exit 0