feat: add free disk space startup check (#331)
This commit is contained in:
1
kiauh.sh
1
kiauh.sh
@@ -86,6 +86,7 @@ function kiauh_update_dialog() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
check_euid
|
check_euid
|
||||||
|
check_free_space
|
||||||
init_logfile
|
init_logfile
|
||||||
set_globals
|
set_globals
|
||||||
kiauh_update_dialog
|
kiauh_update_dialog
|
||||||
|
|||||||
@@ -26,6 +26,14 @@ function check_euid() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function check_free_space() {
|
||||||
|
local gb_req=5
|
||||||
|
if [[ $(df -Pk ${HOME} | sed 1d | grep -v used | awk '{ print $4 "\t" }') -lt $((1048576*$gb_req)) ]]; then
|
||||||
|
echo -e "${red}Free disk space in ${yellow}${HOME}${red} is less than ${gb_req}GB, abort${white}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
#================================================#
|
#================================================#
|
||||||
#============= MESSAGE FORMATTING ===============#
|
#============= MESSAGE FORMATTING ===============#
|
||||||
#================================================#
|
#================================================#
|
||||||
|
|||||||
Reference in New Issue
Block a user