source: lliurex-up/trunk/fuentes/scripts/server/update-cups-on-servers @ 2609

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

refactoring

  • Property svn:executable set to *
File size: 1.1 KB
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 "Share the printers by default on servers")"
15
16# Methods
17
18_ShareTheCups()
19{
20    # This method will be disabled for now
21    # if cups will be managed later by another system
22    # is better
23        if [ -x  /usr/sbin/cupsctl ] ; then
24                if [ ! -e /etc/cups/lliurex-up.token ]; then   
25                        /usr/sbin/cupsctl --share-printers || true
26                        echo "# Remove this file if you want to apply default cups configuration" > /etc/cups/lliurex-up.token
27                        echo "# This file was created on " >> /etc/cups/lliurex-up.token
28                        date >> /etc/cups/lliurex-up.token
29                fi
30        fi
31}
32
33_info()
34{
35        echo "$INFO_MESSAGE"
36}
37
38_migrate()
39{
40        _ShareTheCups
41               
42}
43
44_usage()
45{
46        echo "# Unknown argument"
47
48}
49
50_die()
51{
52        echo "Error: $1"
53        exit 1
54}
55
56ACTION="$1"
57case "$ACTION" in
58        migrate)
59                _migrate
60        ;;
61        info)
62                _info
63        ;;
64        *)
65                _usage
66        ;;
67esac
68
Note: See TracBrowser for help on using the repository browser.