Merge pull request #275 from cronyx/master

replace proccess check to filelock, tanks @themactep
pull/277/head
Igor Zalatov 2022-07-22 20:54:45 +03:00 committed by GitHub
commit fefaa98a95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 5 deletions

View File

@ -3,11 +3,6 @@
# OpenIPC.org | v.20220722
#
if [ $(pidof sysupgrade) ]; then
echo "Sysupgrade script already running!"
exit 1
fi
set -e
echo_c() {
@ -111,6 +106,11 @@ free_resources() {
sync; echo 3 > /proc/sys/vm/drop_caches
}
create_lock() {
[ -f /tmp/sysupgrade.lock ] && echo -e "\e[1;31m\nAnother sysupgrade process is already running!\e[0m\n" && exit 1
touch /tmp/sysupgrade.lock
}
get_device() {
echo -n "/dev/$(grep "\"$1\"" /proc/mtd | cut -d: -f1)"
}
@ -249,6 +249,8 @@ print_sysinfo
echo_c 97 "\nTry '$(basename "$0") --help' for options." && \
exit 0
create_lock
free_resources
[ "$remote_update" -eq 1 ] && download_firmware
[ "$update_kernel" -eq 1 ] && do_update_kernel "$kernel_file"