#!/bin/sh # Installing packages (doing the real dist-upgrade) # gettext domain TEXTDOMAIN="lliurex-up" export TEXTDOMAIN COMMON_LIBRARY="/usr/share/lliurex-up/common-upgrade-vars.sh" if [ -r $COMMON_LIBRARY ] ; then . $COMMON_LIBRARY fi #gettext messages INFO_MESSAGE="$(gettext "Install required packages on a LTSP images")" # Methods _info() { rc_i=1 CURRENT_INODE_ROOT="$(ls -id / | cut -d " " -f1)" if [ $CURRENT_INODE_ROOT -ne 2 ]; then echo "${INFO_MESSAGE} [ENABLED]" else echo "${INFO_MESSAGE} [DISABLED]" fi } _migrate() { rc_i=1 CURRENT_INODE_ROOT="$(ls -id / | cut -d " " -f1)" if [ $CURRENT_INODE_ROOT -ne 2 ]; then rc_i=0 fi rc_t=0 dpkg -s lliurex-ltsp-client >/dev/null 2>/dev/null || rc_t=1 if [ $rc_i -eq 0 ] && [ $rc_t -eq 0 ]; then echo "Somos victimas" apt-get install lliurex-ltsp-client-installed else if [ $rc_i -eq 0 ]; then echo "Chroot inside" else echo "Chroot test failed...nothing to do" fi if [ $rc_t -eq 0 ]; then echo "Package installed" else echo "Package test failed...nothing to do" fi fi } _usage() { echo "# Unknown argument" } _die() { echo "Error: $1" exit 1 } ACTION="$1" case "$ACTION" in migrate) _migrate ;; info) _info ;; *) _usage ;; esac exit 0