#!/bin/sh # ------- # File: lliurex-pamnss-service # Description: very simple script used in llxcfg-pamnss-client # upstart service and init script to delay start of # gdm until the required services (slapd, krb5, ...) # are running # # Author: Luis Garcia Gisbert # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston MA 02110-1301 USA # -------- STAMP_DIR="/var/run/lliurex-pam" CONFIG_FILE="/etc/default/lliurex-pamnss" [ ! -r "$CONFIG_FILE" ] || . $CONFIG_FILE [ "$STAMP_FILE" ] || STAMP_FILE="$STAMP_DIR/lliurex-pam.stamp" [ "$DELAY_FILE" ] || DELAY_FILE="$STAMP_DIR/lliurex-pam.delay" usage(){ echo "Usage: $(basename $0) {test|enable|delay}" >&2 exit 1 } [ "$1" ] || usage case "$1" in enable) mkdir -p "$STAMP_DIR" touch "$STAMP_FILE" rm -f "$DELAY_FILE" ;; delay) mkdir -p "$STAMP_DIR" touch "$DELAY_FILE" ;; test) [ ! -e "$STAMP_FILE" ] || exit 0 [ ! -e "$DELAY_FILE" ] || exit 1 eval "$(llxcfg-showvars ENABLE_NSS_LDAP ENABLE_NSS_LIKEWISE ENABLE_PAM_KRB LLXCFG_IFACE)" [ "$LLXCFG_IFACE" ] || [ "$ENABLE_NSS_LDAP" ] || [ "$ENABLE_NSS_LIKEWISE" ] || [ "$ENABLE_PAM_KRB" ] || exit 0 exit 1 ;; esac exit 0