summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2016-12-13 21:30:16 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2016-12-13 21:30:16 +0100
commite13e28e43f25452d98a1897043a1578e269f8eb6 (patch)
treeec9a0b7bc040761e8a6e51cc3f4f0c3b7413ce59
parenta4b92d4e3fda5209c03389aff6cf35c537b88ab9 (diff)
downloadtips-og-hjelp-e13e28e43f25452d98a1897043a1578e269f8eb6.tar.gz
tips-og-hjelp-e13e28e43f25452d98a1897043a1578e269f8eb6.tar.bz2
tips-og-hjelp-e13e28e43f25452d98a1897043a1578e269f8eb6.zip
tips_of_hjelp: Wrapper around rapporter-feil or kun-tips, depending on group memberships.
-rwxr-xr-xbin/tips_og_hjelp33
1 files changed, 33 insertions, 0 deletions
diff --git a/bin/tips_og_hjelp b/bin/tips_og_hjelp
new file mode 100755
index 0000000..ea35216
--- /dev/null
+++ b/bin/tips_og_hjelp
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+# Copyright 2009-2011 Linnea Skogtvedt <linnea@linuxavdelingen.no>
+# Copyright 2016 Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+
+TEACHERS_GROUP="teachers"
+ADMINS_GROUP="admins"
+
+if [ -f /etc/default/tips_og_hjelp ]; then
+ . /etc/default/tips_og_hjelp
+fi
+
+if id -Gn $(whoami) | grep -qw -e "$TEACHERS_GROUP" -e "$ADMINS_GROUP"
+then
+ exec rapporterfeil "$@"
+else
+ exec kun-tips "$@"
+fi