#!/bin/sh
-echo
-echo
-echo "==================================================="
-echo "REMEMBER !"
-echo ""
-echo "YOU NEED TO RUN THIS ONE AS root"
-echo "==================================================="
-echo
-echo
-
-# Set all local variables
-
-source $PWD/configure.sh
-
-cd $scriptDir
-
- sh installmod.sh $buildType $creasource $generationdir
- sh installmod.sh $buildType $bbtksource $generationdir
- sh installmod.sh $buildType $creamaracassource $generationdir
- sh installmod.sh $buildType $creaenvironmentsource $generationdir
- sh installmod.sh $buildType $creabrukersource $generationdir
- sh installmod.sh $buildType $creaimagesource $generationdir
- sh installmod.sh $buildType $creacontourssource $generationdir
- sh installmod.sh $buildType $crearigidregistrationssource $generationdir
- sh installmod.sh $buildType $bbtkgeditorsource $generationdir
- sh installmod.sh $buildType $creatoolssource $generationdir
+if [ $UID = 0 ]
+then
+ # Set all local variables
+ source $PWD/configure.sh
+ cd $scriptDir
+ sh installmod.sh $buildType $creasource $generationdir
+ sh installmod.sh $buildType $bbtksource $generationdir
exit 0
+ sh installmod.sh $buildType $creamaracassource $generationdir
+ sh installmod.sh $buildType $creaenvironmentsource $generationdir
+ sh installmod.sh $buildType $creabrukersource $generationdir
+ sh installmod.sh $buildType $creaimagesource $generationdir
+ sh installmod.sh $buildType $creacontourssource $generationdir
+ sh installmod.sh $buildType $crearigidregistrationssource $generationdir
+ sh installmod.sh $buildType $bbtkgeditorsource $generationdir
+ sh installmod.sh $buildType $creatoolssource $generationdir
+ touch $installPrefix/share/creatools_base_library_config.sh
+ rm $installPrefix/share/creatools_base_library_config.sh
+ touch $installPrefix/share/creatools_base_library_config.sh
+ chmod 755 $installPrefix/share/creatools_base_library_config.sh
+ echo export PATH='$'PATH:$installPrefix/bin >> $installPrefix/share/creatools_base_library_config.sh
+ echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$installPrefix/lib/creatools >> $installPrefix/share/creatools_base_library_config.sh
+ echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$installPrefix/lib64/creatools >> $installPrefix/share/creatools_base_library_config.sh
+ # modify .bashrc
+ # - remove line 'sh $installPrefix/creatools_install/share/creatools_base_party_libraries_config.sh' if any (with accurate value for ???)
+ sed -i -e '/.*creatools_base_library_config.*/ d' /etc/bashrc
+ # - add line 'sh $installPrefix/creatools_install/share/creatools_base_libraries_config.sh' (with accurate value for ???)
+ echo source $installPrefix/share/creatools_base_library_config.sh >> /etc/bashrc
+else
+ echo
+ echo "..ERROR.."
+ echo "==================================================="
+ echo "REMEMBER !"
+ echo ""
+ echo "YOU NEED TO RUN THIS ONE AS root"
+ echo "==================================================="
+ echo
+ echo
+fi
-
-CREATOOLS_INSTALL_DIR=$installPrefix
-rm $CREATOOLS_INSTALL_DIR/share/creatools_base_library_config.sh
-touch $CREATOOLS_INSTALL_DIR/share/creatools_base_library_config.sh
-chmod 666 $CREATOOLS_INSTALL_DIR/share/creatools_base_library_config.sh
-
-#######################################
-
-touch $installPrefix/share/creatools_base_library_config.sh
-chmod 666 $installPrefix/share/creatools_base_library_config.sh
-
-
-echo export PATH='$'PATH:$installPrefix/bin >> $installPrefix/share/creatools_base_library_config.sh
-echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$installPrefix/lib/creatools >> $installPrefix/share/creatools_base_library_config.sh
-echo export LD_LIBRARY_PATH='$'LD_LIBRARY_PATH:$installPrefix/lib64/creatools >> $installPrefix/share/creatools_base_library_config.sh
-
-# modify .bashrc
-# - remove line 'sh $installPrefix/creatools_install/share/creatools_base_party_libraries_config.sh' if any (with accurate value for ???)
-sed -i -e '/.*creatools_base_library_config.*/ d' ~/.bashrc
-
-# - add line 'sh $installPrefix/creatools_install/share/creatools_base_libraries_config.sh' (with accurate value for ???)
-echo source $installPrefix/share/creatools_base_library_config.sh >> ~/.bashrc