Last active
March 4, 2017 23:06
-
-
Save xerrni/09633af5407272104a377b3cd073529c to your computer and use it in GitHub Desktop.
fix graphs bug quickbox.io
This file contains hidden or 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
#!/bin/bash | |
src1="/srv/rutorrent/home/widgets" | |
src2="/srv/rutorrent/home/inc" | |
cdir=$(pwd) | |
cd ${src1} | |
if [ $? -ne 0 ] # checking if command executed successfully | |
then | |
echo "Can\`t cd into ${src1}" | |
exit 1 | |
fi | |
# repleacing recursively "INETFACE" string with "eth0" inside src1 directory | |
find . -type f -exec sed -i 's/INETFACE/eth0/g' {} + | |
if [ $? -ne 0 ] | |
then | |
echo "Can\`t replace -r string inside ${src1}" | |
exit 1 | |
fi | |
cd ${src2} | |
if [ $? -ne 0 ] | |
then | |
echo "Can\`t cd into ${src1}" | |
exit 1 | |
fi | |
# repleacing recursively "INETFACE" string with "eth0" inside src2 directory | |
find . -type f -exec sed -i 's/INETFACE/eth0/g' {} + | |
if [ $? -ne 0 ] | |
then | |
echo "Can\`t replace -r stirng inside ${src2}" | |
exit 1 | |
fi | |
#going back to previous directory | |
cd ${cdir} | |
if [ $? -ne 0 ] | |
then | |
echo "Can\`t get back to current working dir." | |
exit 1 | |
fi | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment