diff options
author | miwi <miwi@FreeBSD.org> | 2006-11-24 06:36:05 +0800 |
---|---|---|
committer | miwi <miwi@FreeBSD.org> | 2006-11-24 06:36:05 +0800 |
commit | 8e8922fe51d72651b74475cc613881ff793ad574 (patch) | |
tree | 0268877d269ec8a43f009f93dff184b3e8cdeb28 /net/wired/pkg-deinstall | |
parent | e1d6c07c1c429b6083d3357cecfdefdcf321894d (diff) | |
download | freebsd-ports-gnome-8e8922fe51d72651b74475cc613881ff793ad574.tar.gz freebsd-ports-gnome-8e8922fe51d72651b74475cc613881ff793ad574.tar.zst freebsd-ports-gnome-8e8922fe51d72651b74475cc613881ff793ad574.zip |
Wired is an open, modern and free version of the BBS-style
client/server system, providing chat, messaging and file
transfers.
WWW: http://www.zankasoftware.com/wired/
PR: ports/105800
Submitted by: trasz <trasz at pin.if.uz.zgora.pl>
Diffstat (limited to 'net/wired/pkg-deinstall')
-rw-r--r-- | net/wired/pkg-deinstall | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/net/wired/pkg-deinstall b/net/wired/pkg-deinstall new file mode 100644 index 000000000000..ba3037ac19da --- /dev/null +++ b/net/wired/pkg-deinstall @@ -0,0 +1,56 @@ +#! /bin/sh +# +# ex:ts=4 + +ask() { + local question default answer + + question=$1 + default=$2 + if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]; then + read -p "${question} [${default}]? " answer + fi + echo ${answer:-${default}} +} + +yesno() { + local question default answer + + question=$1 + default=$2 + while :; do + answer=$(ask "${question}" "${default}") + case "${answer}" in + [Yy]*) return 0;; + [Nn]*) return 1;; + esac + echo "Please answer yes or no." + done +} + +delete_account() { + local u + + u=$1 + if yesno "Do you want me to remove user \"${u}\"" n; then + pw userdel -n ${u} + echo "Done." + fi +} + +case $2 in + +DEINSTALL) + if ps -axc | grep -qw wired; then + if yesno "Wired is still running. Shall I stop it?" y; then + killall wired + sleep 2 + else + echo "OK ... I hope you know what you are doing." + fi + fi + + delete_account wired + ;; + +esac |