/usr/sbin/drbl-autologin-env-reset is in drbl 2.6.15-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | #!/bin/bash
#
# description: reset autologin account's home directory as initial status.
#
# Author: Steven Shiau <steven _at_ nchc org tw>
# License: GPL
# Load DRBL setting and functions
DRBL_SCRIPT_PATH="${DRBL_SCRIPT_PATH:-/usr/share/drbl}"
. $DRBL_SCRIPT_PATH/sbin/drbl-conf-functions
#
check_if_root
#
usage() {
echo "Turn on/off the drbl-autologin-home-reset service."
echo "Usage: $0 [OPTION] [on|off]"
echo "Options:"
echo "-v, --verbose: verbose mode."
echo "-h, --host IP_ADDRESS: set only for the host with IP_ADDRESS instead of all DRBL clients"
}
# main
while [ $# -gt 0 ]; do
case "$1" in
-h|--host)
shift; specified_host="$1"
shift
;;
-v|--verbose)
shift; verbose="on"
;;
-*) echo "${0}: ${1}: invalid option" >&2
usage >& 2
exit 2 ;;
*) break ;;
esac
done
#
switch=$1
check_switch_on_off $switch
[ -n "$specified_host" ] && HOST_OPT="-h $specified_host"
#
case "$switch" in
on)
# copy drbl-autologin-home-reset to all clients.
drbl-cp-host $DRBL_SCRIPT_PATH/sbin/drbl-autologin-home-reset /etc/init.d/
# add it then turn on it.
drbl-client-service $HOST_OPT drbl-autologin-home-reset add
drbl-client-service $HOST_OPT drbl-autologin-home-reset on
;;
off)
# delete it
drbl-client-service $HOST_OPT drbl-autologin-home-reset off
drbl-client-service $HOST_OPT drbl-autologin-home-reset del
;;
*)
usage && exit 1
;;
esac
|