Skip to content
Snippets Groups Projects
Verified Commit cb8fb5e9 authored by Jan Alexander Steffens (heftig)'s avatar Jan Alexander Steffens (heftig)
Browse files

quassel: Remove givemequassel

parent 4c1cc8e9
No related branches found
No related tags found
No related merge requests found
...@@ -11,7 +11,7 @@ ilines@freenode.net. ...@@ -11,7 +11,7 @@ ilines@freenode.net.
## Add a user ## Add a user
tbd. 1. sudo -u quassel quasselcore --configdir=/var/lib/quassel --add-user
## Migration quassel ## Migration quassel
......
#!/bin/bash -e
if [[ `/usr/bin/whoami` != quassel ]]; then
exec /usr/bin/sudo -u quassel -- "$0"
fi
shopt -s extglob
export PATH=/usr/bin
export LC_ALL=C
case $SUDO_USER in
(""|root) echo >&2 "You need to run this as the user you want to add."
exit 1 ;;
(+([a-z])) ;;
(*) echo >&2 "Invalid user."
exit 1 ;;
esac
if [[ `users` != *$SUDO_USER* ]]; then
echo >&2 "Unknown user."
exit 1
fi
ttyopts=`stty -g`
trap 'stty $ttyopts' EXIT
stty -echo
echo >&2 -n "New password for $SUDO_USER's Quassel user: "
read <&2
pw="$REPLY"
echo
echo >&2 -n "Repeat the password: "
read <&2
echo
if [[ $pw != $REPLY ]]; then
echo >&2 "Passwords don't match."
exit 1
fi
if printf '%s\n' $pw $pw | quasselcore --configdir=/var/lib/quassel --change-userpass $SUDO_USER &>/dev/null; then
echo >&2 "Updated password for user '$SUDO_USER'."
exit 0
fi
if printf '%s\n' $SUDO_USER $pw $pw | quasselcore --configdir=/var/lib/quassel --add-user &>/dev/null; then
echo >&2 "Added user '$SUDO_USER'."
exit 0
fi
echo >&2 "Quassel error."
exit 1
%users ALL = (quassel) NOPASSWD: /usr/local/bin/givemequassel ""
...@@ -50,12 +50,6 @@ ...@@ -50,12 +50,6 @@
- name: install quassel.service snippet - name: install quassel.service snippet
copy: src=quassel.service.d dest=/etc/systemd/system/quassel.service.d/local.conf owner=root group=root mode=0644 copy: src=quassel.service.d dest=/etc/systemd/system/quassel.service.d/local.conf owner=root group=root mode=0644
- name: install givemequassel script
copy: src=givemequassel dest=/usr/local/bin/givemequassel owner=root group=root mode=0755
- name: install givemequassel sudoers config
copy: src=givemequassel.sudoers dest=/etc/sudoers.d/givemequassel
- name: start and enable quassel - name: start and enable quassel
service: name={{ item }} enabled=yes state=started service: name={{ item }} enabled=yes state=started
with_items: with_items:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment