Skip to content

Commit

Permalink
2.2.13
Browse files Browse the repository at this point in the history
  • Loading branch information
lbr38 committed Jan 2, 2024
1 parent 8c5b5ed commit c405923
Show file tree
Hide file tree
Showing 31 changed files with 29 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-deb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
mkdir -p /tmp/linupdate-build/DEBIAN
mkdir -p /tmp/linupdate-build/etc/linupdate/modules
mkdir -p /tmp/linupdate-build/opt/linupdate
mkdir -p /tmp/linupdate-build/opt/linupdate/functions/
mkdir -p /tmp/linupdate-build/opt/linupdate/src/
mkdir -p /tmp/linupdate-build/opt/linupdate/mods-available/
mkdir -p /tmp/linupdate-build/opt/linupdate/mods-enabled/
mkdir -p /tmp/linupdate-build/opt/linupdate/agents-available/
Expand All @@ -38,7 +38,7 @@ jobs:
- name: Copy files to include in the build
run: |
cp -r ${GITHUB_WORKSPACE}/functions/* /tmp/linupdate-build/opt/linupdate/functions/
cp -r ${GITHUB_WORKSPACE}/src/* /tmp/linupdate-build/opt/linupdate/src/
cp -r ${GITHUB_WORKSPACE}/mods-available/* /tmp/linupdate-build/opt/linupdate/mods-available/
cp -r ${GITHUB_WORKSPACE}/service/* /tmp/linupdate-build/opt/linupdate/service/
cp ${GITHUB_WORKSPACE}/linupdate /tmp/linupdate-build/opt/linupdate/linupdate
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-rpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
mkdir -p $HOME/rpmbuild/SPECS
mkdir -p /etc/linupdate/modules
mkdir -p /opt/linupdate
mkdir -p /opt/linupdate/functions/
mkdir -p /opt/linupdate/src/
mkdir -p /opt/linupdate/mods-available/
mkdir -p /opt/linupdate/mods-enabled/
mkdir -p /opt/linupdate/agents-available/
Expand All @@ -43,7 +43,7 @@ jobs:
- name: Copy files to include in the build
run: |
cp -r ${GITHUB_WORKSPACE}/functions/* /opt/linupdate/functions/
cp -r ${GITHUB_WORKSPACE}/src/* /opt/linupdate/src/
cp -r ${GITHUB_WORKSPACE}/mods-available/* /opt/linupdate/mods-available/
cp -r ${GITHUB_WORKSPACE}/service/* /opt/linupdate/service/
cp ${GITHUB_WORKSPACE}/linupdate /opt/linupdate/linupdate
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
mkdir -p /tmp/linupdate-build/DEBIAN
mkdir -p /tmp/linupdate-build/etc/linupdate/modules
mkdir -p /tmp/linupdate-build/opt/linupdate
mkdir -p /tmp/linupdate-build/opt/linupdate/functions/
mkdir -p /tmp/linupdate-build/opt/linupdate/src/
mkdir -p /tmp/linupdate-build/opt/linupdate/mods-available/
mkdir -p /tmp/linupdate-build/opt/linupdate/mods-enabled/
mkdir -p /tmp/linupdate-build/opt/linupdate/agents-available/
Expand All @@ -35,7 +35,7 @@ jobs:
- name: Copy files to include in the build
run: |
cp -r ${GITHUB_WORKSPACE}/functions/* /tmp/linupdate-build/opt/linupdate/functions/
cp -r ${GITHUB_WORKSPACE}/src/* /tmp/linupdate-build/opt/linupdate/src/
cp -r ${GITHUB_WORKSPACE}/mods-available/* /tmp/linupdate-build/opt/linupdate/mods-available/
cp -r ${GITHUB_WORKSPACE}/service/* /tmp/linupdate-build/opt/linupdate/service/
cp ${GITHUB_WORKSPACE}/linupdate /tmp/linupdate-build/opt/linupdate/linupdate
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
mkdir -p $HOME/rpmbuild/SPECS
mkdir -p /etc/linupdate/modules
mkdir -p /opt/linupdate
mkdir -p /opt/linupdate/functions/
mkdir -p /opt/linupdate/src/
mkdir -p /opt/linupdate/mods-available/
mkdir -p /opt/linupdate/mods-enabled/
mkdir -p /opt/linupdate/agents-available/
Expand All @@ -101,7 +101,7 @@ jobs:
- name: Copy files to include in the build
run: |
cp -r ${GITHUB_WORKSPACE}/functions/* /opt/linupdate/functions/
cp -r ${GITHUB_WORKSPACE}/src/* /opt/linupdate/src/
cp -r ${GITHUB_WORKSPACE}/mods-available/* /opt/linupdate/mods-available/
cp -r ${GITHUB_WORKSPACE}/service/* /opt/linupdate/service/
cp ${GITHUB_WORKSPACE}/linupdate /opt/linupdate/linupdate
Expand Down
12 changes: 6 additions & 6 deletions linupdate
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ DATE_FULL=$(date +%d-%m-%Y_%Hh%M) # Today date in 'DD-MM-YYYY_
TIME=$(date +%H:%M) # Time in '00:00' format
TIME_FULL=$(date +%Hh%Mm%Ss) # Time in '00h00m00s' format
LINUPDATE="${BASE_DIR}/linupdate" # Main program
FUNCTIONS="${BASE_DIR}/functions" # Functions directory
SRC_SIR="${BASE_DIR}/src" # Source code directory
LOGS_DIR="/var/log/linupdate" # Logs directory
ETC_DIR="/etc/linupdate" # Configuration files directory
CONF="${ETC_DIR}/linupdate.conf" # Main configuration file
Expand Down Expand Up @@ -112,15 +112,15 @@ mkdir -p "$MODULES_ENABLED_DIR"
mkdir -p "$AGENTS_ENABLED_DIR"
mkdir -p "$SERVICE_DIR"

# If functions dir does not exist then quit
if [ ! -d "$FUNCTIONS" ];then
# If source code dir does not exist then quit
if [ ! -d "$SRC_DIR" ];then
echo -e "[$YELLOW ERROR $RESET] Some linupdate core files are missing. You might reinstall linupdate."
exit 1
fi

# Sourcing all files inside functions dir
for FUNCTION_FILE in $(ls -A1 "$FUNCTIONS");do
source "$FUNCTIONS/$FUNCTION_FILE"
# Sourcing all files inside src dir
for SRC_FILE in $(ls -A1 "$SRC_DIR");do
source "$SRC_DIR/$SRC_FILE"
done

# Check that system is valid before continue
Expand Down
20 changes: 14 additions & 6 deletions mods-available/reposerver.mod
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,14 @@ function mod_load
grep "^URL=" "$MOD_CONF" >> "$TMP_MOD_CONF"
fi

if grep -q "^IP=" "$MOD_CONF";then
grep "^IP=" "$MOD_CONF" >> "$TMP_MOD_CONF"
fi

if grep -q "^PACKAGE_TYPE=" "$MOD_CONF";then
grep "^PACKAGE_TYPE=" "$MOD_CONF" >> "$TMP_MOD_CONF"
fi

# Section [AGENT]
echo -e "\n[AGENT]" >> "$TMP_MOD_CONF"
if ! grep -q "^WATCH_FOR_REQUEST=" "$MOD_CONF";then
Expand All @@ -567,9 +575,9 @@ function mod_load
grep "^WATCH_INTERFACE=" "$MOD_CONF" >> "$TMP_MOD_CONF"
fi

# Remplacement du fichier de conf par le fichier précédemment construit
cat "$TMP_MOD_CONF" > "$MOD_CONF"
rm -f "$TMP_MOD_CONF"
# Remplacement du fichier de conf par le fichier précédemment construit
cat "$TMP_MOD_CONF" > "$MOD_CONF"
rm -f "$TMP_MOD_CONF"

# Si l'URL du serveur de repo n'est pas renseignée alors on ne charge pas le module
if [ -z $(grep "^URL=" $MOD_CONF | cut -d'=' -f2 | sed 's/"//g') ];then
Expand Down Expand Up @@ -679,14 +687,14 @@ function getServerConf
echo "" >> "$TMP_FILE_CLIENT"

# Sauvegarde de la partie [AGENT] si existe
sed -n -e '/\[AGENT\]/,/^$/p' "$MOD_CONF" > "$TMP_FILE_AGENT"
sed -n -e '/\[AGENT\]/,/^$/p' "$MOD_CONF" > "$TMP_FILE_AGENT"
# Ajout d'un saut de ligne car chaque section doit être correctement séparée
echo "" >> "$TMP_FILE_AGENT"

# Nouvelle conf [REPOSERVER]
echo "[REPOSERVER]" >> "$TMP_FILE_REPOSERVER"
echo "IP=\"$REPOSERVER_IP\"" >> "$TMP_FILE_REPOSERVER"
echo "URL=\"$REPOSERVER_URL\"" >> "$TMP_FILE_REPOSERVER"
echo "IP=\"$REPOSERVER_IP\"" >> "$TMP_FILE_REPOSERVER"
echo "PACKAGE_TYPE=\"$REPOSERVER_PACKAGE_TYPE\"" >> "$TMP_FILE_REPOSERVER"
echo "" >> "$TMP_FILE_REPOSERVER"

Expand All @@ -700,7 +708,7 @@ function getServerConf
sed -i '/^$/N;/^\n$/D' "$MOD_CONF"

# Suppression des fichiers temporaires
rm "$TMP_FILE_MODULE" -f
rm "$TMP_FILE_MODULE" -f
rm "$TMP_FILE_CLIENT" -f
rm "$TMP_FILE_AGENT" -f
rm "$TMP_FILE_REPOSERVER" -f
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.2.12
2.2.13

0 comments on commit c405923

Please sign in to comment.