Guest User

Untitled

a guest
Dec 30th, 2022
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. #!/bin/bash
  2. SVRPATH=`grep 'Directory ".*"' /etc/httpd/conf/httpd.conf -m 1 -o`
  3. SVRPATH=${SVRPATH/Directory \"/}
  4. SVRPATH=${SVRPATH::-1}
  5. NEWPATH=$1
  6. echo "Replacing $SVRPATH with $NEWPATH"
  7. perl -i -pe "s~$SVRPATH~$NEWPATH~g" /etc/httpd/conf/httpd.conf
  8. systemctl restart httpd
Advertisement
Add Comment
Please, Sign In to add comment