source: lliurex-up/trunk/fuentes/scripts/server/fix-server-flavour-on-update @ 2609

Last change on this file since 2609 was 2609, checked in by kbut, 3 years ago

refactoring

File size: 939 bytes
Line 
1#!/bin/sh
2# Installing packages (doing the real dist-upgrade)
3
4# gettext domain
5TEXTDOMAIN="lliurex-up"
6export TEXTDOMAIN
7
8COMMON_LIBRARY="/usr/share/lliurex-up/common-upgrade-vars.sh"
9if [  -r $COMMON_LIBRARY  ] ; then 
10        . $COMMON_LIBRARY
11fi
12
13#gettext messages
14INFO_MESSAGE="$(gettext "Fix Server flavour on update")"
15
16# Methods
17
18fix_server_flavour()
19{
20        # If the flavour is already fixed...
21        if [ ! -d ${ETCTOKENSPATH} ]; then
22                echo " * [ LliureX Up ] : Fix Server Flavour ... creating dir for tokens"
23                mkdir -p ${ETCTOKENSPATH}
24        fi
25
26        if [ ! -f ${ETCTOKENSPATH}/${CDDSERVERLOST} ]; then
27                date +%Y-%m-%d > ${ETCTOKENSPATH}/${CDDSERVERLOST}
28                touch   ${TOKENPATH}${TOKENSERVER}
29        fi
30   
31}
32
33_info()
34{
35        echo "$INFO_MESSAGE"
36}
37
38_migrate()
39{
40        fix_server_flavour
41}
42
43_usage()
44{
45        echo "# Unknown argument"
46
47}
48
49_die()
50{
51        echo "Error: $1"
52        exit 1
53}
54
55ACTION="$1"
56case "$ACTION" in
57        migrate)
58                _migrate
59        ;;
60        info)
61                _info
62        ;;
63        *)
64                _usage
65        ;;
66esac
67
Note: See TracBrowser for help on using the repository browser.