Magellan Linux

Diff of /mcore-src/trunk/mcore-tools/src/modules/systemd/systemd.client.class.in

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2164 by niro, Fri Jan 10 13:59:40 2014 UTC revision 2269 by niro, Tue Jan 14 10:34:57 2014 UTC
# Line 5  require basic-system Line 5  require basic-system
5    
6  set_system_service()  set_system_service()
7  {  {
8   local command="$1"   local command="${CLASS_ARGV[0]}"
9   local service="$2"   local service="${CLASS_ARGV[1]}"
10   local opts="$3"   local opts="${CLASS_ARGV[2]}"
11    
12   [[ -z ${command} ]] && help_system_service && return 1   [[ -z ${command} ]] && help_system_service && return 1
13   [[ -z ${service} ]] && help_system_service && return 1   [[ -z ${service} ]] && help_system_service && return 1
# Line 26  set_system_service() Line 26  set_system_service()
26    
27   if [[ -n $(${chrooted} systemctl status ${service} | grep 'Reason: No such file or directory') ]]   if [[ -n $(${chrooted} systemctl status ${service} | grep 'Reason: No such file or directory') ]]
28   then   then
29   eecho "Service '${service}' unkown!"   eecho "Service '${service}' unknown!"
30   return 1   return 1
31   fi   fi
32    
# Line 50  set_system_service() Line 50  set_system_service()
50    
51  get_system_service()  get_system_service()
52  {  {
53   local command="$1"   local command="${CLASS_ARGV[0]}"
54   local service="$2"   local service="${CLASS_ARGV[1]}"
55    
56   [[ -z ${command} ]] && help_system_service && return 1   [[ -z ${command} ]] && help_system_service && return 1
57   [[ -z ${service} ]] && help_system_service && return 1   [[ -z ${service} ]] && help_system_service && return 1
# Line 70  get_system_service() Line 70  get_system_service()
70    
71   if [[ -n $(${chrooted} systemctl status ${service} | grep 'Reason: No such file or directory') ]]   if [[ -n $(${chrooted} systemctl status ${service} | grep 'Reason: No such file or directory') ]]
72   then   then
73   eecho "Service '${service}' unkown!"   eecho "Service '${service}' unknown!"
74   return 1   return 1
75   fi   fi
76    
77   case "${command}" in   case "${command}" in
78   status) ${chrooted} systemctl status "${service}" ;;   status) ${chrooted} systemctl status "${service}" ;;
79   enabled) ${chrooted} systemctl is-enabled "${service}"; rvecho "$?" ;;   enabled) ${chrooted} systemctl is-enabled "${service}"; rvecho "$?" ;;
80   runlevel) rvecho "$(readline ${MROOT}/etc/systemd/system/default.target)" ;;   runlevel) rvecho "$(readline ${MROOT}@@SYSTEMDSYSTEMCONFDIR@@/default.target)" ;;
81   *) help_system_service && return ;;   *) help_system_service && return ;;
82   esac   esac
83  }  }

Legend:
Removed from v.2164  
changed lines
  Added in v.2269