-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #170 from poap-xyz/bugfix/failing-linux-tests
Bugfix/failing linux tests
- Loading branch information
Showing
11 changed files
with
565 additions
and
507 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Developer scripts | ||
|
||
The scripts in this folder are convenience, scripts that are not used by the production system, and are purely for developer convenience. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#/bin/bash | ||
|
||
# The script is designed to make lsof run without having to input a password for sudo | ||
|
||
# Variables | ||
visudo_folder=/etc/sudoers.d | ||
visudo_file=${visudo_folder}/firebase_kill_emulators | ||
tempfolder=/tmp | ||
visudoconfig=" | ||
Cmnd_Alias LSOF = /usr/sbin/lsof -i | ||
ALL ALL = NOPASSWD: LSOF | ||
" | ||
|
||
# Check if visudo file is correct, make it if not | ||
function enable_visudo() { | ||
echo "Checking visudo file format" | ||
echo -e "$visudoconfig" >>$tempfolder/visudo.tmp | ||
sudo visudo -c -f $tempfolder/visudo.tmp >/dev/null 2>&1 | ||
if [ "$?" -eq "0" ]; then | ||
echo "visudo file format is correct" | ||
if ! test -d "$visudo_folder"; then | ||
echo "Creating folder $visudo_folder" | ||
sudo mkdir -p "$visudo_folder" | ||
fi | ||
echo "Copying visudo file to $visudo_file" | ||
sudo cp $tempfolder/visudo.tmp $visudo_file | ||
rm $tempfolder/visudo.tmp | ||
else | ||
echo "visudo file format is incorrect, please check the file and try again" | ||
rm $tempfolder/visudo.tmp | ||
exit 1 | ||
fi | ||
echo "Setting permissions on $visudo_file" | ||
sudo chmod 440 $visudo_file | ||
} | ||
|
||
# Check if visudo file exists, make it if not | ||
if ! test -f "$visudo_file"; then | ||
enable_visudo | ||
else | ||
echo "visudo file exists, doing nothing" | ||
fi |
Oops, something went wrong.