-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcss_background_switcher.sh
27 lines (22 loc) · 4.15 KB
/
css_background_switcher.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#Cetrulin 09-06-13 css_background_switcher v0.1
#!/bin/bash
n=$((RANDOM % 3)) #random number between different options in switcher
case ${n} in #in each case, background is changed for different one
0) find /RUTA_SKIN_MAGENTO/styles.css | xargs grep "../images/BACKGROUND_IMAGE1.png" && sed 's/BACKGROUND_IMAGE1.png") no-repeat fixed 0 #89B556; background-position:center right;/BACKGROUND_IMAGE2.png") no-repeat fixed 0 #89B556; background-position:center center;/g' /RUTA_SKIN_MAGENTO/styles.css > /RUTA_SKIN_MAGENTO/temp.txt
find /RUTA_SKIN_MAGENTO/styles.css | xargs grep "../images/BACKGROUND_IMAGE2.png" && sed 's/BACKGROUND_IMAGE2.png") no-repeat fixed 0 #89B556; background-position:center center;/BACKGROUND_IMAGE3.png") no-repeat fixed 0 #89B556; background-position:center center;/g' /RUTA_SKIN_MAGENTO/styles.css > /RUTA_SKIN_MAGENTO/temp.txt
find /RUTA_SKIN_MAGENTO/styles.css | xargs grep "../images/BACKGROUND_IMAGE3.png" && sed 's/BACKGROUND_IMAGE3.png") no-repeat fixed 0 #89B556; background-position:center center;/BACKGROUND_IMAGE4.png") no-repeat fixed 0 #89B556; background-position:bottom left;/g' /RUTA_SKIN_MAGENTO/styles.css > /RUTA_SKIN_MAGENTO/temp.txt
find /RUTA_SKIN_MAGENTO/styles.css | xargs grep "../images/BACKGROUND_IMAGE4.png" && sed 's/BACKGROUND_IMAGE4.png") no-repeat fixed 0 #89B556; background-position:bottom left;/BACKGROUND_IMAGE1.png") no-repeat fixed 0 #89B556; background-position:center right;/g' /RUTA_SKIN_MAGENTO/styles.css > /RUTA_SKIN_MAGENTO/temp.txt
;;
1) find /RUTA_SKIN_MAGENTO/styles.css | xargs grep "../images/BACKGROUND_IMAGE1.png" && sed 's/BACKGROUND_IMAGE1.png") no-repeat fixed 0 #89B556; background-position:center right;/BACKGROUND_IMAGE3.png") no-repeat fixed 0 #89B556; background-position:center center;/g' /RUTA_SKIN_MAGENTO/styles.css > /RUTA_SKIN_MAGENTO/temp.txt
find /RUTA_SKIN_MAGENTO/styles.css | xargs grep "../images/BACKGROUND_IMAGE2.png" && sed 's/BACKGROUND_IMAGE2.png") no-repeat fixed 0 #89B556; background-position:center center;/BACKGROUND_IMAGE4.png") no-repeat fixed 0 #89B556; background-position:bottom left;/g' /RUTA_SKIN_MAGENTO/styles.css > /RUTA_SKIN_MAGENTO/temp.txt
find /RUTA_SKIN_MAGENTO/styles.css | xargs grep "../images/BACKGROUND_IMAGE3.png" && sed 's/BACKGROUND_IMAGE3.png") no-repeat fixed 0 #89B556; background-position:center center;/BACKGROUND_IMAGE1.png") no-repeat fixed 0 #89B556; background-position:center right;/g' /RUTA_SKIN_MAGENTO/styles.css > /RUTA_SKIN_MAGENTO/temp.txt
find /RUTA_SKIN_MAGENTO/styles.css | xargs grep "../images/BACKGROUND_IMAGE4.png" && sed 's/BACKGROUND_IMAGE4.png") no-repeat fixed 0 #89B556; background-position:bottom left;/BACKGROUND_IMAGE2.png") no-repeat fixed 0 #89B556; background-position:center center;/g' /RUTA_SKIN_MAGENTO/styles.css > /RUTA_SKIN_MAGENTO/temp.txt
;;
2) find /RUTA_SKIN_MAGENTO/styles.css | xargs grep "../images/BACKGROUND_IMAGE1.png" && sed 's/BACKGROUND_IMAGE1.png") no-repeat fixed 0 #89B556; background-position:center right;/BACKGROUND_IMAGE4.png") no-repeat fixed 0 #89B556; background-position:bottom left;/g' /RUTA_SKIN_MAGENTO/styles.css > /RUTA_SKIN_MAGENTO/temp.txt
find /RUTA_SKIN_MAGENTO/styles.css | xargs grep "../images/BACKGROUND_IMAGE2.png" && sed 's/BACKGROUND_IMAGE2.png") no-repeat fixed 0 #89B556; background-position:center center;/BACKGROUND_IMAGE1.png") no-repeat fixed 0 #89B556; background-position:center right;/g' /RUTA_SKIN_MAGENTO/styles.css > /RUTA_SKIN_MAGENTO/temp.txt
find /RUTA_SKIN_MAGENTO/styles.css | xargs grep "../images/BACKGROUND_IMAGE3.png" && sed 's/BACKGROUND_IMAGE3.png") no-repeat fixed 0 #89B556; background-position:center center;/BACKGROUND_IMAGE2.png") no-repeat fixed 0 #89B556; background-position:center center;/g' /RUTA_SKIN_MAGENTO/styles.css > /RUTA_SKIN_MAGENTO/temp.txt
find /RUTA_SKIN_MAGENTO/styles.css | xargs grep "../images/BACKGROUND_IMAGE4.png" && sed 's/BACKGROUND_IMAGE4.png") no-repeat fixed 0 #89B556; background-position:bottom left;/BACKGROUND_IMAGE3.png") no-repeat fixed 0 #89B556; background-position:center center;/g' /RUTA_SKIN_MAGENTO/styles.css > /RUTA_SKIN_MAGENTO/temp.txt
;;
esac
mv /RUTA_SKIN_MAGENTO/temp.txt /RUTA_SKIN_MAGENTO/styles.css
echo 'done'