Find Jobs
Hire Freelancers

Bash Script Help!

$10-30 USD

Fullført
Lagt ut omtrent 5 år siden

$10-30 USD

Betalt ved levering
I need this script refined so that if $j already exists in the file it does not echo the two start/stop entries. #!/bin/bash SMATCH=`echo $SUDO_USER | cut -d@ -f2`; if [ "$SMATCH" != "[login to view URL]" ] ;then { S_USER="$SUDO_USER@[login to view URL]" } else { S_USER=$SUDO_USER; } fi; for i in $( ls -1A /home/$S_USER/*.service); do j=$(basename $i) chmod 755 /home/$S_USER/$j chown root:root /home/$S_USER/$j mv /home/$S_USER/$j /etc/systemd/system/ systemctl enable $j systemctl daemon-reload k=$(cat /etc/sudoers.d/DEV | head -1 | awk '{print $1}'); j=$(echo $j| cut -d. -f1); echo "" >> /etc/sudoers.d/DEV echo "$k ALL=PASSWD: /bin/systemctl start $j" >> /etc/sudoers.d/DEV echo "$k ALL=PASSWD: /bin/systemctl stop $j" >> /etc/sudoers.d/DEV done
Prosjekt-ID: 18759655

Om prosjektet

15 forslag
Eksternt prosjekt
Aktiv 5 år siden

Ønsker du å tjene penger?

Fordeler med budgivning på Freelancer

Angi budsjettet og tidsrammen
Få betalt for arbeidet ditt
Skisser forslaget ditt
Det er gratis å registrere seg og by på jobber
Tildelt til:
Brukeravatar
Hi, Do you mean , $j exist in /home/$S_user/*.service directory ? Or you mean $j exist in the sudoers file? Yes, you can do that and its a simple check. Thanks
$12 USD om 1 dag
5,0 (26 omtaler)
4,8
4,8
15 frilansere byr i gjennomsnitt $23 USD for denne jobben
Brukeravatar
I can do the fix with a grep check on the file. Will be done in 5 minutes. Thank you ...............
$15 USD om 1 dag
4,9 (307 omtaler)
6,8
6,8
Brukeravatar
Hey there, I'm a System Engineer with coding skills. I had developed tons of Bash scripts. Do you mean $j in the name of the file or in the content of the file?
$30 USD om 1 dag
5,0 (38 omtaler)
4,9
4,9
Brukeravatar
G'day, I'm an experienced and talented Linux DevOps engineer. Bash scripting is my bread and butter, I have complete confidence in my ability to help you resolve your issue with your sudoers generation script.
$30 USD om 1 dag
5,0 (4 omtaler)
4,6
4,6
Brukeravatar
Hello, I'm an expert in Linux (18 years of experience; Debian, Ubuntu, CentOS and many others), bash/shell scripting, etc. Please look at my profile for my previous bash/shell projects.
$30 USD om 1 dag
4,9 (21 omtaler)
4,4
4,4
Brukeravatar
Hi, I can help you changed bash script. I'm ready to start working right now. My experience in the administration of the Linux system and web-dev (PHP, MYSQL, POSTGRESQL, CakePHP, HTML, JS, ETC.) is more than 8 years!
$25 USD om 1 dag
5,0 (26 omtaler)
4,2
4,2
Brukeravatar
Good day, I may be able to help you with this problems of your if you ever do so consider my help. Thanks...
$25 USD om 1 dag
5,0 (10 omtaler)
3,7
3,7
Brukeravatar
Hi, I am very happy to bid your project. I read your requirements carefully,so i see what you mean. I have been experiments with Linux, Shell Script, Software Architecture, System Admin, UNIX,Php. I'd like to work with you. i'll complete this project for you to the best my ability and without condition I am looking forward to meeting you
$30 USD om 1 dag
5,0 (7 omtaler)
2,9
2,9
Brukeravatar
Hello, I can have your script in 24H You can check my profile, and worked before with Bash Scripting I can check this on RHEL7, Centos, Debian Ubuntu Server or any other distribution based on Linux kernel Kind regards.
$15 USD om 1 dag
5,0 (2 omtaler)
2,0
2,0
Brukeravatar
Hi I am Kamal Mehta. I have 12 Years of experience in Shell Scripting. Please contact me to discuss more details. I also wanted to see any sample output of your existing script where you can clearly show me which line you don't want to print. Also I am bidding to this project from my phone. I will be available to work after 24 hours from now. Thanks! Regards Kamal Mehta
$35 USD om 1 dag
5,0 (2 omtaler)
1,5
1,5
Brukeravatar
Tell me what the requirement exactly is, i think the shell script is written in a very complicated way and I am sure there are systems functions to do the same. I can rewrite the script with a better logic for the bid amount.
$35 USD om 1 dag
0,0 (0 omtaler)
0,0
0,0
Brukeravatar
Hi i am Kamlesh, software developer. I have 8 year of experience in shell scripts. i have completed multiple projects on shell scripts. i can complete this on time.
$15 USD om 1 dag
0,0 (0 omtaler)
0,0
0,0
Brukeravatar
Hello, An if statement with an inverted grep match on the variable can help you achieve this. It would be better to check for "start $j" and "stop $j" and adding only the one missing. A check on the $j variable only might result in duplicate lines for either start or stop. I am a certified Red Hat Systems Administrator {my certification id can be verified online} and not a bot randomly applying on posts as web designers or translators. Looking forward to help you. Kind regards, Taranveer.
$15 USD om 1 dag
0,0 (0 omtaler)
0,0
0,0

Om klienten

UNITED STATESs flagg
Franklin, United States
5,0
20
Betalingsmetode bekreftet
Medlem siden okt. 28, 2015

Klientbekreftelse

Takk! Vi har sendt deg en lenke for at du skal kunne kreve din gratis kreditt.
Noe gikk galt. Vær så snill, prøv på nytt.
Registrerte brukere Publiserte jobber
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Forhåndsvisning innlasting
Tillatelse gitt for geolokalisering.
Påloggingsøkten din er utløpt og du har blitt logget ut. Logg på igjen.