1#!/bin/sh
2# usage: x11vnc_pw [file]  (default: ~/.vnc/passwd)
3
4if [ "X$1" = "X" ]; then
5	file=$HOME/.vnc/passwd
6else
7	file=$1
8fi
9
10stty -echo
11printf "Password: "
12read pw1; echo ""
13printf "Verify:   "
14read pw2; echo ""
15stty  echo
16
17if [ "X$pw1" != "X$pw2" ]; then
18	echo "passwords do not match."
19	exit 1
20fi
21
22x11vnc -help > /dev/null 2>&1
23x11vnc -storepasswd "$pw1" "$file"
24ls -l "$file"
25