regex with "if" does not work
Hello All
I'am setting up 2 jumpservers (in a Cluster) at my Company and i'm stuck with a little problem here. The idea is: If the User is created, /etc/skel will copy a script into the homedir of every user. This script should be executable only by regular users, which names are like "tkfoo". tk or tx at the beginning, followed by three letters and/or numbers. If i execute this script with root, it will not allow to sync the homedir. When i execute this with a tk... or tx... user it should run and sync the homedirs, but it doesn't. I get the Error message: "You are not permitted to rsync your homedir as user $USER, you have to be tk*** or tx***" I thought that =~ should work, but it doesnt. I don't know how i should get it to work, any help is appreciated. Anyways, here is the tiny script: Code:
#!/bin/bash |
try this
Code:
if [[ $USER = t[kx]* ]]; then |
Thanks!
Well that did it.
It works! I tried like 10 different things and nothing worked. Many thanks to you! |
All times are GMT -5. The time now is 05:32 PM. |