4 . /usr/share/debconf/confmodule
7 . /usr/share/carnet-upgrade/data.sh
8 . /usr/share/carnet-upgrade/messages.sh
9 . /usr/share/carnet-upgrade/functions.sh
11 # provjeri da li su paketi iz prvog polja instalirani i to strpaj u debconf
15 for i in $(echo "$services_to_check" | sed 's/ */ /g'| awk -F' ' '{print $1}')
18 if ! echo $services | grep -q $i; then
19 services="$services $i"
24 if [ -n "$services" ]; then
25 db_set carnet-upgrade/check-services "$services"
34 # get service param from stdin
35 user=$(echo "$line" | awk -F ' ' '{print $2}')
36 psname=$(echo "$line" | awk -F ' ' '{print $3}')
37 nicename=$(echo "$line" | awk -F ' ' '{print $4}')
39 # check if service is running
40 if ! pgrep -u $user -f "$psname" > /dev/null; then
41 failed_services="$failed_services, $nicename"
46 echo ${failed_services#, }
49 # uzmi iz debconfa instalirane servise, i provjeri rade li
51 local services i failed_services msg_header
54 upgrade) msg_header="$msg_finished_upgrade"
57 msg_header="$msg_finished"
61 db_get carnet-upgrade/check-services || true
62 services="${RET// /|}"
65 echo "$services_to_check" \
66 | grep -E "^($services)" \
71 if [ -n "$failed_services" ]; then
72 notice "$msg_header$msg_failed_services$failed_services"
78 # checkiraj da li je sto zapisano u debconf
80 db_get carnet-upgrade/check-services || true
83 if [ -n "$debconf" ]; then
90 # prikazi sto je zapisano u debconf
92 db_get carnet-upgrade/check-services || true
97 preupgrade) cs_preupgrade
99 postupgrade) cs_postupgrade
105 *) echo "Usage: $0 (preupgrade|postupgrade|check|show)"