Find Jobs
Hire Freelancers

Bash Script Help!

$10-30 USD

Opravljeno
Objavljeno pred približno 5 leti

$10-30 USD

Plačilo ob dostavi
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
ID projekta: 18759655

Več o projektu

15 ponudb
Projekt na daljavo
Aktivno pred 5 leti

Želite zaslužiti?

Prednosti oddajanja ponudb na Freelancerju

Nastavite svoj proračun in časovni okvir
Prejmite plačilo za svoje delo
Povzetek predloga
Registracija in oddajanje ponudb sta brezplačna
Dodeljeno:
Avatar uporabnika
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 v 1 dnevu
5,0 (26 ocen)
4,8
4,8
15 freelancerjev je oddalo ponudbo s povprečno vrednostjo $23 USD za to delo
Avatar uporabnika
I can do the fix with a grep check on the file. Will be done in 5 minutes. Thank you ...............
$15 USD v 1 dnevu
4,9 (307 ocen)
6,8
6,8
Avatar uporabnika
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 v 1 dnevu
5,0 (38 ocen)
4,9
4,9
Avatar uporabnika
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 v 1 dnevu
5,0 (4 ocen)
4,6
4,6
Avatar uporabnika
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 v 1 dnevu
4,9 (21 ocen)
4,4
4,4
Avatar uporabnika
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 v 1 dnevu
5,0 (26 ocen)
4,2
4,2
Avatar uporabnika
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 v 1 dnevu
5,0 (10 ocen)
3,7
3,7
Avatar uporabnika
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 v 1 dnevu
5,0 (7 ocen)
2,9
2,9
Avatar uporabnika
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 v 1 dnevu
5,0 (2 ocen)
2,0
2,0
Avatar uporabnika
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 v 1 dnevu
5,0 (2 ocen)
1,5
1,5
Avatar uporabnika
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 v 1 dnevu
0,0 (0 ocen)
0,0
0,0
Avatar uporabnika
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 v 1 dnevu
0,0 (0 ocen)
0,0
0,0
Avatar uporabnika
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 v 1 dnevu
0,0 (0 ocen)
0,0
0,0

O stranki

Zastava UNITED STATES
Franklin, United States
5,0
20
Plačilna metoda je verificirana
Član(ica) od okt. 28, 2015

Verifikacija stranke

Hvala! Po e-pošti smo vam poslali povezavo za prevzem brezplačnega dobropisa.
Pri pošiljanju vašega e-sporočila je šlo nekaj narobe. Poskusite znova.
Registrirani uporabniki Skupaj objavljenih del
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Nalaganje predogleda
Geolociranje je bilo dovoljeno.
Vaša prijavna seja je potekla, zato ste bili odjavljeni. Prosimo, da se znova prijavite.