From: Valentin Vidic Date: Thu, 23 Apr 2009 11:30:14 +0000 (+0200) Subject: Check if machine needs a reboot. X-Git-Tag: debian/5.0.0~46 X-Git-Url: http://ftp.carnet.hr/pub/carnet-debian/scm?a=commitdiff_plain;h=14762ba1a453a7d51c38d403b35055b1592e1376;p=carnet-upgrade.git Check if machine needs a reboot. --- diff --git a/src/actions/main.queue b/src/actions/main.queue index 7cdaa75..3a32013 100644 --- a/src/actions/main.queue +++ b/src/actions/main.queue @@ -3,6 +3,7 @@ true first_warning true check_my_version true check_upgrade true check_grsec_kernel +true check_reboot pkg xlibs remove_x true remove_bloat true remove_cn_bloat diff --git a/src/functions.sh b/src/functions.sh index da07bc4..4620e8a 100644 --- a/src/functions.sh +++ b/src/functions.sh @@ -467,7 +467,7 @@ check_grsec_kernel () { return 0 fi - if [ "$ver" = "${ver#2.6.2[4-9]}" ] || reboot_required; then + if [ "$ver" = "${ver#2.6.2[4-9]}" ]; then # kernel too old notice " Prije prelaska na Debian Lenny potrebno je napraviti nadogradnju na najnoviji kernel. @@ -483,6 +483,18 @@ Nakon toga ponovno pozovite ovu skriptu." fi } +check_reboot () { + reboot_required || return 0 + + LC_MESSAGES=hr_HR dialog --backtitle "$title" --yesno "$reboot_warning" 18 +75 + if [ $? -eq 0 ]; then + log "Reboot before continuing." + exit 0 + else + log "Proceed without reboot." + fi +} + # check if the latest kernel is booted reboot_required () { local default_kernel kernel_package running_release running_version diff --git a/src/messages.sh b/src/messages.sh index 35d3f04..86c6bd0 100644 --- a/src/messages.sh +++ b/src/messages.sh @@ -15,6 +15,13 @@ http://sistemac.carnet.hr/system/files/carnet-upgrade.pdf Zelite li nastaviti?" +reboot_warning="Na racunalu je pronadjenja verzija kernela novija od trenutno \ +pokrenute. Prije pocetka nadogradnje paketa preporuceno je pokrenuti racunalo \ +s najnovijim dostupnim kernelom. Nakon reboota ponovno pokrenite nadogradnju \ +pozivom naredbe 'carnet-upgrade'. + +Zelite li rebootati racunalo prije nadogradnje?" + msg_remove_x="Na racunalu je pronadjena instalacija KDE, GNOME ili \ X Window System grafickog okruzenja koji nisu nuzni za normalan rad \ posluzitelja. Uklanjanje ovih aplikacija ubrzat ce proceduru nadogradnje i \