27 lines
656 B
Bash
Executable File
27 lines
656 B
Bash
Executable File
#!/bin/bash
|
|
|
|
TMP_FILE=$(mktemp)
|
|
|
|
# Ask for username
|
|
dialog --backtitle "Remove SMB User" --inputbox "Enter username to be removed:" 10 40 2>"$TMP_FILE"
|
|
USERNAME=$(<"$TMP_FILE")
|
|
|
|
|
|
|
|
# 3) Call the external script and capture output
|
|
# adjust the path (“../add_smb_user.sh”) as needed
|
|
TMP_OUT=$(mktemp)
|
|
bash ./../remove_smb_user.sh "$USERNAME" >"$TMP_OUT" 2>&1
|
|
|
|
# 4) Display the result (use --msgbox for short, --textbox for multiline)
|
|
dialog --backtitle "Remove SMB User" \
|
|
--title "Result" \
|
|
--textbox "$TMP_OUT" 20 60
|
|
|
|
rm -f "$TMP_OUT"
|
|
|
|
|
|
# dialog --msgbox "User '$USERNAME' with given password would be created." 8 50
|
|
|
|
rm -f "$TMP_FILE"
|