Changeset 23247 for ipk/source.sh4/titanswapskins_tobayer01/CONTROL
- Timestamp:
- Sep 4, 2013, 12:34:44 AM (13 years ago)
- Location:
- ipk/source.sh4/titanswapskins_tobayer01/CONTROL
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
ipk/source.sh4/titanswapskins_tobayer01/CONTROL/postinst
r23203 r23247 2 2 3 3 releaseversion=22775 4 plugin="tobayer01 swapskin" 5 plugindir="/var/swap/titanskins/tobayer01" 4 plugin_short="tobayer01" 5 plugin_type="swapskin" 6 plugin_target="/var/swap/titanskins" 7 8 plugin_dir="$plugin_target/$plugin_short" 9 plugin="$plugin_short $plugin_type" 10 6 11 imageversion=`cat /etc/version | cut -d "_" -f2 | sed 's/M//'`; 7 link=`readlink /var/swap`8 12 9 if [ `df | grep /dev/mtdblock | grep mnt | sed 's/ \+/ /g' | cut -d ' ' -f4 | head -n1 | wc -l` -eq 1 ] && [ $link = "/mnt/swapextensions" ]; then 10 SPACE=`df | grep /dev/mtdblock | grep mnt | sed 's/ \+/ /g' | cut -d ' ' -f4 | head -n1` 11 FREE=`expr $SPACE - 100` 12 echo "New free space: $FREE kb" 13 else 14 sync 15 fi 13 14 ### FUNCTIONS ### 15 16 RES_COL=60 # column number to place the status message 17 MOVE_TO_COL="echo -en \\033[${RES_COL}G" # command to move to the configured column number 18 19 echo_success() { # function to print the SUCCESS status 20 $MOVE_TO_COL; echo -n "[ OK ]"; echo 21 } 22 23 echo_failure() { 24 $MOVE_TO_COL; echo -n "[FAILED]"; echo # function to print the FAILED status message 25 } 26 27 28 29 ### MAIN ### 30 31 sync 32 SPACE=`getfreespace $plugin_target` 33 FREE=`expr $SPACE - 100` 34 echo 35 echo "New free space: $FREE kB" 36 16 37 17 38 if [ "$imageversion" -gt "$releaseversion" ]; then 18 39 echo "Successfully installed $plugin (non-release version)." 19 40 # ==> rm skin_release.xml 20 rm $plugin dir/skin_release.xml41 rm $plugin_dir/skin_release.xml 21 42 else 22 43 echo "Successfully installed $plugin (release version)." 23 44 # ==> mv skin_release.xml skin.xml" 24 mv $plugin dir/skin_release.xml $plugindir/skin.xml45 mv $plugin_dir/skin_release.xml $plugin_dir/skin.xml 25 46 fi 26 47 -
ipk/source.sh4/titanswapskins_tobayer01/CONTROL/postrm
r23203 r23247 1 1 #!/bin/sh 2 2 3 plugin ="tobayer01 swapskin"4 plugin dir="/var/swap/titanskins/tobayer01"5 link=`readlink /var/swap` 3 plugin_short="tobayer01" 4 plugin_type="swapskin" 5 plugin_target="/var/swap/titanskins" 6 6 7 rm -rf $plugindir 7 plugin_dir="$plugin_target/$plugin_short" 8 plugin="$plugin_short $plugin_type" 8 9 9 if [ `df | grep /dev/mtdblock | grep mnt | sed 's/ \+/ /g' | cut -d ' ' -f4 | head -n1 | wc -l` -eq 1 ] && [ $link = "/mnt/swapextensions" ]; then 10 SPACE=`df | grep /dev/mtdblock | grep mnt | sed 's/ \+/ /g' | cut -d ' ' -f4 | head -n1` 11 FREE=`expr $SPACE - 100` 12 echo "New free space: $FREE kb" 13 else 14 sync 15 fi 10 11 ### FUNCTIONS ### 12 13 RES_COL=60 # column number to place the status message 14 MOVE_TO_COL="echo -en \\033[${RES_COL}G" # command to move to the configured column number 15 16 echo_success() { # function to print the SUCCESS status 17 $MOVE_TO_COL; echo -n "[ OK ]"; echo 18 } 19 20 echo_failure() { 21 $MOVE_TO_COL; echo -n "[FAILED]"; echo # function to print the FAILED status message 22 } 23 24 25 26 ### MAIN ### 27 28 rm -rf $plugin_dir 29 30 sync 31 SPACE=`getfreespace $plugin_target` 32 FREE=`expr $SPACE - 100` 33 echo 34 echo "New free space: $FREE kB" 16 35 17 36 echo "Successfully removed $plugin." -
ipk/source.sh4/titanswapskins_tobayer01/CONTROL/preinst
r23202 r23247 1 1 #!/bin/sh 2 2 3 plugin="tobayer01 swapskin" 4 plugindir="/var/swap/titanskins/tobayer01" 5 pluginsize=2300 3 plugin_size=2300 4 plugin_short="tobayer01" 5 plugin_type="swapskin" 6 plugin_target="/var/swap/titanskins" 7 8 plugin_dir="$plugin_target/$plugin_short" 9 plugin="$plugin_short $plugin_type" 10 6 11 model=`cat /etc/model` 7 link=`readlink /var/swap`8 12 buildgroup=`cat /etc/.buildgroup` 9 13 10 sync11 14 12 echo "Checking your box type..." 15 ### FUNCTIONS ### 16 17 RES_COL=60 # column number to place the status message 18 MOVE_TO_COL="echo -en \\033[${RES_COL}G" # command to move to the configured column number 19 20 echo_success() { # function to print the SUCCESS status 21 $MOVE_TO_COL; echo -n "[ OK ]"; echo 22 } 23 24 echo_failure() { 25 $MOVE_TO_COL; echo -n "[FAILED]"; echo # function to print the FAILED status message 26 } 27 28 29 30 ### MAIN ### 31 32 echo -n "Checking box type..." 13 33 if [ "$model" = "" ]; then 14 echo "" 15 echo "Sorry! This plugin is not available for your $model, because it will not work correctly!" 34 echo_failure 35 echo 36 echo "Sorry, $plugin is not available for the $model!" 16 37 echo "Aborting installation..." 17 38 exit 1 18 39 else 19 echo "Box type $model is OK."40 echo_success 20 41 fi 21 42 22 echo "" 23 echo "Checking swapstick..." 24 if [ ! -d /var/swap/titanskins/ ]; then 25 echo "----------------------" 26 echo "Swapstick not found..." 27 echo "----------------------" 43 44 echo -n "Checking installation directory..." 45 if [ ! -d $plugin_target ]; then 46 echo_failure 47 echo 48 echo "Sorry, $plugin_target not found!" 49 echo "Aborting installation..." 28 50 exit 1 29 51 else 30 echo "Swapstick is OK."52 echo_success 31 53 fi 32 54 33 if [ `df | grep /dev/mtdblock | grep mnt | sed 's/ \+/ /g' | cut -d ' ' -f4 | head -n1 | wc -l` -eq 1 ] && [ $link = "/mnt/swapextensions" ]; then 34 SPACE=`df | grep /dev/mtdblock | grep mnt | sed 's/ \+/ /g' | cut -d ' ' -f4 | head -n1` 35 FREE=`expr $SPACE - 100` 36 echo "" 37 echo "Checking free space..." 38 echo "Package size $pluginsize kb" 39 echo "Free space $FREE kb" 40 if [ "$FREE" -lt "$pluginsize" ]; then 41 echo "Sorry, not enough free space on your device!" 42 exit 1 43 else 44 echo "OK" 45 fi 55 56 sync 57 SPACE=`getfreespace $plugin_target` 58 FREE=`expr $SPACE - 100` 59 echo -n "Checking free space ($plugin_size in $FREE kB)..." 60 if [ "$FREE" -lt "$plugin_size" ]; then 61 echo_failure 62 echo 63 echo "Sorry, not enough free space in $plugin_target!" 64 echo "Aborting installation..." 65 exit 1 46 66 else 47 sync67 echo_success 48 68 fi 49 69 50 echo "" 51 echo "Checking OS..." 52 if [ `cat /etc/motd | grep $buildgroup | grep M | grep rev | wc -l` -eq 0 ]; then 53 echo "---------------------------" 54 echo "Don't use this TPK package!" 55 echo "---" 56 echo "Only for $buildgroup image!" 57 echo "---------------------------" 70 71 echo -n "Checking image type..." 72 if [ `cat /etc/version | grep $buildgroup | wc -l` -eq 0 ]; then 73 echo_failure 74 echo 75 echo "Sorry, $plugin is not available for this image type!" 76 echo "Aborting installation..." 58 77 exit 1 59 78 else 60 echo "OS is OK."79 echo_success 61 80 fi 62 81 63 rm -rf $plugindir 64 echo "" 65 echo "Installing $plugin..." 82 83 rm -rf $plugin_dir 84 85 echo -n "Installing $plugin..." 86 echo_success 66 87 67 88 exit 0 -
ipk/source.sh4/titanswapskins_tobayer01/CONTROL/prerm
r23203 r23247 1 1 #!/bin/sh 2 2 3 plugin="tobayer01 swapskin" 4 link=`readlink /var/swap` 3 plugin_short="tobayer01" 4 plugin_type="swapskin" 5 plugin_target="/var/swap/titanskins" 5 6 6 if [ `df | grep /dev/mtdblock | grep mnt | sed 's/ \+/ /g' | cut -d ' ' -f4 | head -n1 | wc -l` -eq 1 ] && [ $link = "/mnt/swapextensions" ]; then 7 SPACE=`df | grep /dev/mtdblock | grep mnt | sed 's/ \+/ /g' | cut -d ' ' -f4 | head -n1` 8 FREE=`expr $SPACE - 100` 9 echo "Old free space: $FREE kb" 10 else 11 sync 12 fi 7 plugin_dir="$plugin_target/$plugin_short" 8 plugin="$plugin_short $plugin_type" 13 9 14 echo "Removing $plugin..." 10 11 ### FUNCTIONS ### 12 13 RES_COL=60 # column number to place the status message 14 MOVE_TO_COL="echo -en \\033[${RES_COL}G" # command to move to the configured column number 15 16 echo_success() { # function to print the SUCCESS status 17 $MOVE_TO_COL; echo -n "[ OK ]"; echo 18 } 19 20 echo_failure() { 21 $MOVE_TO_COL; echo -n "[FAILED]"; echo # function to print the FAILED status message 22 } 23 24 25 26 ### MAIN ### 27 28 sync 29 SPACE=`getfreespace $plugin_target` 30 FREE=`expr $SPACE - 100` 31 echo "Old free space: $FREE kB" 32 33 34 echo -n "Removing $plugin..." 35 echo_success 15 36 16 37 exit 0
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/openaaf/chrome/common/titannit_trac_banner.png)