-
-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored snoopy enabling/disabling:
- moved snoopy-enable.sh into snoopy-enable - created snoopy-disable - both are now installed in sbin/ - snoopy path is now hardcoded into them at ./configure time - added 'make disable' option - 'make uninstall' now also executes 'make disable' - configure.ac: require sed - configure.ac: added some AC_SUBST macros that are required by features listed above
- Loading branch information
Showing
7 changed files
with
91 additions
and
20 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,44 @@ | ||
#!/bin/sh | ||
|
||
|
||
|
||
# This is a script that disables system-wide snoopy installation. | ||
# You have to run this script as a privileged user. | ||
# This script is also run when you execute "make disable". | ||
|
||
|
||
|
||
### Where is the library installed? | ||
# | ||
LIBDIR="@SNOOPY_LIBDIR@" | ||
|
||
|
||
|
||
### Check user that is running this script | ||
# | ||
touch /etc/ld.so.preload | ||
if [ ! -w /etc/ld.so.preload ]; then | ||
echo | ||
echo 'SNOOPY ERROR: /etc/ld.so.preload not writable - are you running this script as a unprivileged user?' | ||
echo | ||
exit 1 | ||
fi | ||
|
||
|
||
|
||
### Do the actual installation | ||
# | ||
COUNT=`grep -Ec "/(lib)?snoopy.so" /etc/ld.so.preload` | ||
if [ "$COUNT" -gt "1" ]; then | ||
echo | ||
echo "SNOOPY ERROR: Multiple instances of (lib)snoopy.so found in /etc/ld.so.preload. Unable to proceed." | ||
echo | ||
exit 1 | ||
elif [ "$COUNT" -eq "1" ]; then | ||
echo -n "SNOOPY: Removing from /etc/ld.so.preload: " | ||
cat /etc/ld.so.preload | grep -E "/(lib)?snoopy.so" | ||
sed -i "/\/\(lib\)\?snoopy.so/d" /etc/ld.so.preload | ||
echo "SNOOPY: Disabled." | ||
else | ||
echo "SNOOPY: Snoopy is NOT enabled on this system." | ||
fi |
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