Skip to content

Commit

Permalink
Fully check before autoupdate zram
Browse files Browse the repository at this point in the history
Signed-off-by: Ethan Dye <[email protected]>
  • Loading branch information
ecdye committed Dec 18, 2024
1 parent 445e0bf commit edc39d0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion functions/zram.bash
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ init_zram_mounts() {
if ! cond_redirect rm -rf /usr/local/lib/zram-config; then echo "FAILED (zram-config lib)"; return 1; fi
if ! cond_redirect rm -f /var/log/zram-config; then echo "FAILED (zram-config link)"; return 1; fi
if cond_redirect rm -f /etc/logrotate.d/zram-config; then echo "OK"; else echo "FAILED (logrotate)"; return 1; fi
elif zram_is_installed && [[ -z $zram_reset ]]; then
elif zram_is_installed; then
if [[ $1 == "autoupdate" ]] && [[ -n $zram_reset ]]; then return 0; fi
echo -n "$(timestamp) [openHABian] Updating zram service... "
if ! cond_redirect systemctl stop zram-config.service; then echo "FAILED (stop zram)"; return 1; fi
if ! cond_redirect mkdir -p /usr/local/lib/zram-config/; then echo "FAILED (create directory)"; return 1; fi
Expand Down
2 changes: 1 addition & 1 deletion openhabian-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ else
load_create_config
openhabian_console_check
openhabian_update_check
zram_is_installed && init_zram_mounts "update" && echo "zram_reset=done" >> /etc/openhabian.conf # update zram to fix potential issues
zram_is_installed && init_zram_mounts "autoupdate" && echo "zram_reset=done" >> /etc/openhabian.conf # update zram to fix potential issues
jsscripting_npm_check "openhab"
jsscripting_npm_check "openhab_rules_tools"
while show_main_menu; do
Expand Down

0 comments on commit edc39d0

Please sign in to comment.