source: lliurex-up/trunk/fuentes/scripts/common/fix-apt-pinning @ 2609

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

refactoring

File size: 946 bytes
Line 
1#!/bin/sh
2
3
4# gettext domain
5TEXTDOMAIN="lliurex-up"
6export TEXTDOMAIN
7
8# APT PINNING FILE
9PINNING_FILE="/usr/share/lliurex-up/lliurex-pinning.cfg"
10PINNING_DEST="/etc/apt/preferences.d/lliurex-pinning"
11
12# APT CONFIGURATION FILE
13APT_CONF_FILE="/usr/share/lliurex-up/99lliurex-conf"
14APT_CONF_DEST="/etc/apt/apt.conf.d/99lliurex-conf"
15
16
17COMMON_LIBRARY="/usr/share/lliurex-up/common-upgrade-vars.sh"
18if [  -r $COMMON_LIBRARY  ] ; then 
19        . $COMMON_LIBRARY
20fi
21
22#gettext messages
23INFO_MESSAGE="$(gettext "Fixed pinning")"
24
25# Methods
26_info()
27{
28        echo "$INFO_MESSAGE"
29}
30
31_usage()
32{
33        echo " * [ LliureX Up ] : # Unknown argument"
34}
35
36
37_migrate()
38{
39
40[ -f "$PINNING_DEST" ] || cp -f "$PINNING_FILE" "$PINNING_DEST"
41[ -f "${APT_CONF_DEST}" ] || cp -f "${APT_CONF_FILE}" "${APT_CONF_DEST}"
42   
43}
44
45_die()
46{
47        echo " * [ LliureX Up ] : Error: $1"
48        exit 1
49}
50
51ACTION="$1"
52case "$ACTION" in
53        migrate)
54                _migrate
55        ;;
56        info)
57                _info
58        ;;
59        *)
60                _usage
61        ;;
62esac
63
64exit 0
65
66
Note: See TracBrowser for help on using the repository browser.