[SOLVED]Bash script dosen't continue when run

About writing shell scripts and making the most of your shell
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Locked
CalebOWolf
Level 1
Level 1
Posts: 41
Joined: Mon Nov 27, 2017 9:08 am
Location: Missouri, USA
Contact:

[SOLVED]Bash script dosen't continue when run

Post by CalebOWolf »

I have made this script to allow for me to install all of my applications on debian distros but when I run it, it doesn't run it all the way through. What am I doing wrong and how can I fix this. Also if there's anyway that I can make this script automated entirely without me doing anything and all I have to do is just run it, please let me know so I can edit it and not have to deal with coming back and checking on it.

(also I made two files of the same one but I think the differences are only the -y that's added to the sudo apt install and update commands)
(as well as I want to be able to also install spotify and dropbox without me having to get a .deb package)
setup.txt
setup-edit.txt
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
HappyWags WolfLove Arwoooo!
[LM 20.3]
PC Specs
CPU: Intel Core i5 4590
GPU: AMD R7 250
RAM: 8 GB (4x2 GB)
SFF Tower: Dell Optiplex 3020 SFF
SSD: Samsung 256 GB
Wi-Fi: TP-Link AC1300 Archer T6E
jchelpau

Re: Bash script dosen't continue when run

Post by jchelpau »

Could it be that sudo is waiting for your password and times out? Try removing all the 'sudo's then running your script using sudo.
CalebOWolf
Level 1
Level 1
Posts: 41
Joined: Mon Nov 27, 2017 9:08 am
Location: Missouri, USA
Contact:

Re: Bash script dosen't continue when run

Post by CalebOWolf »

jchelpau wrote: Sat Apr 06, 2019 6:18 pm Could it be that sudo is waiting for your password and times out? Try removing all the 'sudo's then running your script using sudo.
so when I do one sudo, it will remember all for the remainder of the terminal session
HappyWags WolfLove Arwoooo!
[LM 20.3]
PC Specs
CPU: Intel Core i5 4590
GPU: AMD R7 250
RAM: 8 GB (4x2 GB)
SFF Tower: Dell Optiplex 3020 SFF
SSD: Samsung 256 GB
Wi-Fi: TP-Link AC1300 Archer T6E
jchelpau

Re: Bash script dosen't continue when run

Post by jchelpau »

No, it will remember it for a number of minutes. But it will run your script with root privileges and not need multiple sudos.
CalebOWolf
Level 1
Level 1
Posts: 41
Joined: Mon Nov 27, 2017 9:08 am
Location: Missouri, USA
Contact:

Re: Bash script dosen't continue when run

Post by CalebOWolf »

jchelpau wrote: Sat Apr 06, 2019 6:19 pm No, it will remember it for a number of minutes. But it will run your script with root privileges and not need multiple sudos.
Tried it with and without.
Without stopped at neofetch
with ran all the way through
with the sudo's is what I'm gonna have to go with, so we can rule too many sudo's out
HappyWags WolfLove Arwoooo!
[LM 20.3]
PC Specs
CPU: Intel Core i5 4590
GPU: AMD R7 250
RAM: 8 GB (4x2 GB)
SFF Tower: Dell Optiplex 3020 SFF
SSD: Samsung 256 GB
Wi-Fi: TP-Link AC1300 Archer T6E
jchelpau

Re: Bash script dosen't continue when run

Post by jchelpau »

Can you post the error that happens with neofetch?
CalebOWolf
Level 1
Level 1
Posts: 41
Joined: Mon Nov 27, 2017 9:08 am
Location: Missouri, USA
Contact:

Re: Bash script dosen't continue when run

Post by CalebOWolf »

jchelpau wrote: Sat Apr 06, 2019 6:24 pm Can you post the error that happens with neofetch?
There's no error it just stops midway through
HappyWags WolfLove Arwoooo!
[LM 20.3]
PC Specs
CPU: Intel Core i5 4590
GPU: AMD R7 250
RAM: 8 GB (4x2 GB)
SFF Tower: Dell Optiplex 3020 SFF
SSD: Samsung 256 GB
Wi-Fi: TP-Link AC1300 Archer T6E
jchelpau

Re: Bash script dosen't continue when run

Post by jchelpau »

Can you post a full log of the script output?
CalebOWolf
Level 1
Level 1
Posts: 41
Joined: Mon Nov 27, 2017 9:08 am
Location: Missouri, USA
Contact:

Re: Bash script dosen't continue when run

Post by CalebOWolf »

jchelpau wrote: Sat Apr 06, 2019 6:32 pm Can you post a full log of the script output?
I don't have a log of it but I do have another problem, I want the two ppa's for openrazer and polychromatic to either be able to say yes to them or either be cancelled if they're already added/installed, they always run and are required
HappyWags WolfLove Arwoooo!
[LM 20.3]
PC Specs
CPU: Intel Core i5 4590
GPU: AMD R7 250
RAM: 8 GB (4x2 GB)
SFF Tower: Dell Optiplex 3020 SFF
SSD: Samsung 256 GB
Wi-Fi: TP-Link AC1300 Archer T6E
jchelpau

Re: Bash script dosen't continue when run

Post by jchelpau »

Could you make a log?
CalebOWolf
Level 1
Level 1
Posts: 41
Joined: Mon Nov 27, 2017 9:08 am
Location: Missouri, USA
Contact:

Re: Bash script dosen't continue when run

Post by CalebOWolf »

jchelpau wrote: Sat Apr 06, 2019 6:46 pm Could you make a log?
log.txt
HappyWags WolfLove Arwoooo!
[LM 20.3]
PC Specs
CPU: Intel Core i5 4590
GPU: AMD R7 250
RAM: 8 GB (4x2 GB)
SFF Tower: Dell Optiplex 3020 SFF
SSD: Samsung 256 GB
Wi-Fi: TP-Link AC1300 Archer T6E
jchelpau

Re: Bash script dosen't continue when run

Post by jchelpau »

It looks like all the commands in the script ran.
CalebOWolf
Level 1
Level 1
Posts: 41
Joined: Mon Nov 27, 2017 9:08 am
Location: Missouri, USA
Contact:

Re: Bash script dosen't continue when run

Post by CalebOWolf »

jchelpau wrote: Sat Apr 06, 2019 7:00 pm It looks like all the commands in the script ran.
Just had to fix a few of them but I noticed that these two commands
sudo add-apt-repository ppa:openrazer/stable
sudo add-apt-repository ppa:polychromatic/stable

aren't running with a yes or by just going on ahead and skipping them if they're found to be installed already
HappyWags WolfLove Arwoooo!
[LM 20.3]
PC Specs
CPU: Intel Core i5 4590
GPU: AMD R7 250
RAM: 8 GB (4x2 GB)
SFF Tower: Dell Optiplex 3020 SFF
SSD: Samsung 256 GB
Wi-Fi: TP-Link AC1300 Archer T6E
CalebOWolf
Level 1
Level 1
Posts: 41
Joined: Mon Nov 27, 2017 9:08 am
Location: Missouri, USA
Contact:

Re: Bash script dosen't continue when run

Post by CalebOWolf »

CalebO5 wrote: Sat Apr 06, 2019 7:04 pm
jchelpau wrote: Sat Apr 06, 2019 7:00 pm It looks like all the commands in the script ran.
Just had to fix a few of them but I noticed that these two commands
sudo add-apt-repository ppa:openrazer/stable
sudo add-apt-repository ppa:polychromatic/stable

aren't running with a yes or by just going on ahead and skipping them if they're found to be installed already
Found that I had to add a -y to the end of the repository part but will they be skipped if found to be already installed? I'll check
HappyWags WolfLove Arwoooo!
[LM 20.3]
PC Specs
CPU: Intel Core i5 4590
GPU: AMD R7 250
RAM: 8 GB (4x2 GB)
SFF Tower: Dell Optiplex 3020 SFF
SSD: Samsung 256 GB
Wi-Fi: TP-Link AC1300 Archer T6E
deepakdeshp
Level 20
Level 20
Posts: 12341
Joined: Sun Aug 09, 2015 10:00 am

Re: Bash script dosen't continue when run

Post by deepakdeshp »

If I have helped you solve a problem, please add [SOLVED] to your first post title, it helps other users looking for help.
Regards,
Deepak

Mint 21.1 Cinnamon 64 bit with AMD A6 / 8GB
Mint 21.1 Cinnamon AMD Ryzen3500U/8gb
CalebOWolf
Level 1
Level 1
Posts: 41
Joined: Mon Nov 27, 2017 9:08 am
Location: Missouri, USA
Contact:

Re: Bash script dosen't continue when run

Post by CalebOWolf »

Have no clue what that's supposed to help me with.
HappyWags WolfLove Arwoooo!
[LM 20.3]
PC Specs
CPU: Intel Core i5 4590
GPU: AMD R7 250
RAM: 8 GB (4x2 GB)
SFF Tower: Dell Optiplex 3020 SFF
SSD: Samsung 256 GB
Wi-Fi: TP-Link AC1300 Archer T6E
deepakdeshp
Level 20
Level 20
Posts: 12341
Joined: Sun Aug 09, 2015 10:00 am

Re: Bash script dosen't continue when run

Post by deepakdeshp »

set -x at the beginning of the script will echo all commands on the terminal which will indicate where the script halts.
If I have helped you solve a problem, please add [SOLVED] to your first post title, it helps other users looking for help.
Regards,
Deepak

Mint 21.1 Cinnamon 64 bit with AMD A6 / 8GB
Mint 21.1 Cinnamon AMD Ryzen3500U/8gb
CalebOWolf
Level 1
Level 1
Posts: 41
Joined: Mon Nov 27, 2017 9:08 am
Location: Missouri, USA
Contact:

Re: Bash script dosen't continue when run

Post by CalebOWolf »

deepakdeshp wrote: Sun Apr 07, 2019 4:52 am set -x at the beginning of the script will echo all commands on the terminal which will indicate where the script halts.
Got it, Ill try that out and see what happens
HappyWags WolfLove Arwoooo!
[LM 20.3]
PC Specs
CPU: Intel Core i5 4590
GPU: AMD R7 250
RAM: 8 GB (4x2 GB)
SFF Tower: Dell Optiplex 3020 SFF
SSD: Samsung 256 GB
Wi-Fi: TP-Link AC1300 Archer T6E
Locked

Return to “Scripts & Bash”