Simple PPTP, L2TP/IPsec, OpenVPN installers
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
vpn-install/ipsec/deluser.sh

22 lines
455 B

#!/usr/bin/env bash
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
source $DIR/env.sh
if [[ ! -e $CHAPSECRETS ]] || [[ ! -r $CHAPSECRETS ]] || [[ ! -w $CHAPSECRETS ]]; then
echo "$CHAPSECRETS is not exist or not accessible (are you root?)"
exit 1
fi
if [[ $# -gt 0 ]]; then
LOGIN="$1"
fi
while [[ -z "$LOGIN" ]];
do
read -p "Enter name: " LOGIN
done
sed -i -e "/^$LOGIN[[:space:]]/d" $CHAPSECRETS
echo "$CHAPSECRETS updated!"