2014-07-17 17:03:00 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
ps=$(ps ux \
|
|
|
|
| sed 1d \
|
|
|
|
| grep -v tty1 \
|
|
|
|
| grep -v pts \
|
|
|
|
| grep -v '?' \
|
|
|
|
| awk '{ print $2 }')
|
|
|
|
|
|
|
|
if test -n "$ps"; then
|
|
|
|
echo "Killing: $ps"
|
|
|
|
kill $ps 2> /dev/null
|
|
|
|
kill -9 $ps 2> /dev/null
|
|
|
|
fi
|
|
|
|
|
|
|
|
exec 2> /dev/null
|
|
|
|
pw=$1
|
|
|
|
if test -z "$pw"; then
|
2014-07-29 15:25:43 -04:00
|
|
|
pw=$(cat ~/.slock_passwd | xargs printf '%s')
|
2014-07-17 17:03:00 -04:00
|
|
|
fi
|
|
|
|
exec slock -p "$pw"
|