23 lines
610 B
Bash
Executable file
23 lines
610 B
Bash
Executable file
#!/bin/bash
|
|
|
|
SCRIPTPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
|
|
|
|
infile=/home/admin666/external_addresses
|
|
|
|
if [ $# -ne 1 ] ; then
|
|
echo -e "Params:\t<username>" >&2
|
|
exit
|
|
fi
|
|
|
|
user="$1"
|
|
|
|
res=$( grep "^$1 " $infile )
|
|
[[ -z "$res" ]] && echo "No entry in backup file for $user" >&2 && exit
|
|
|
|
bkpmail=$(echo "$res" | cut -d" " -f2)
|
|
[[ -z "$bkpmail" ]] && echo "No mapping in backup file for $user" >&2 && exit
|
|
|
|
$SCRIPTPATH/sendmail_reset_warning.sh "$user@a-lec.org"
|
|
$SCRIPTPATH/sendmail_reset_warning.sh "$bkpmail"
|
|
|
|
echo "$SCRIPTPATH/reset_account.sh $user $bkpmail > /dev/null" | at now+2days
|