Created
April 28, 2015 17:20
-
-
Save arubdesu/cbd18d99a8376f6a568e to your computer and use it in GitHub Desktop.
webex ftw - this filename is actually postflight, yet it's inside a flat pkg for EventCenter. Notice the commented-out 'security issue' section, mkdir -p of a parent folder and then the subfolder, and super-odd dylib odd/even math
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/sh | |
| # | |
| # This postflight script mv the tmp install location to user home dir | |
| # | |
| Logfile=/tmp/.ciscoInstallpostflight.log | |
| dyliblist[9]=xml.dylib | |
| dyliblist[0]=rtp-29.0.0.1.dylib | |
| dyliblist[1]=rtp.dylib | |
| dyliblist[2]=cmcrypto-29.13.0.1.dylib | |
| dyliblist[3]=cmcrypto.dylib | |
| dyliblist[4]=xml-29.0.0.1.dylib | |
| dyliblist[5]=xml.dylib | |
| dyliblist[6]=libssl.0.1.4.7.dylib | |
| dyliblist[7]=libssl.dylib | |
| dyliblist[8]=libcrypto.0.1.4.7.dylib | |
| dyliblist[9]=libcrypto.dylib | |
| PWD=`pwd` | |
| echo "PWD:$PWD" > $Logfile | |
| #find the login users | |
| USERS=`users` | |
| user_dir=~ | |
| for user in $USERS; do | |
| validuser=$user | |
| echo "login user:$user" >> $Logfile | |
| done | |
| for user in $USERS; do | |
| result=`stat -f '%Su' $user_dir` | |
| if [ $result == $user ]; then | |
| validuser=$user | |
| echo "validuser:$user" >> $Logfile | |
| fi | |
| done | |
| validgroup=`id -gn $validuser` | |
| echo "validgroup:$validgroup" >> $Logfile | |
| cd "$2" | |
| dest_dir=`pwd` | |
| cd .. | |
| dest_parent_dir=`pwd` | |
| dirlist=`ls` | |
| for dir in $dirlist; do | |
| if [ $dest_parent_dir/$dir == $dest_dir ]; then | |
| install_dir_name=$dir | |
| fi | |
| done | |
| cp_dest_parent_dir=~/Library/Application\ Support/WebEx\ Folder | |
| cp_dest_dir=$cp_dest_parent_dir/$install_dir_name | |
| mkdir -p -m 775 "$cp_dest_parent_dir" | |
| mkdir -p -m 775 "$cp_dest_dir" | |
| chown $validuser:$validgroup "$cp_dest_parent_dir" | |
| chown $validuser:$validgroup "$cp_dest_dir" | |
| if [ -d "$cp_dest_dir" ]; then | |
| cd "$cp_dest_dir" | |
| rm -rf `ls "$2"` | |
| fi | |
| cd "$PWD" | |
| cp_plugin_dir=~/Library/Internet\ Plug-Ins | |
| echo "cp_dest_parent_dir:$cp_dest_parent_dir" >> $Logfile | |
| echo "cp_dest_dir:$cp_dest_dir" >> $Logfile | |
| echo "cp_plugin_dir:$cp_plugin_dir" >> $Logfile | |
| rm -rf "$cp_dest_dir" | |
| mv "$2" "$cp_dest_parent_dir" | |
| rm -rf "$cp_plugin_dir/WebEx64.plugin" | |
| rm -rf "$cp_dest_parent_dir/atgpcext64.bundle" | |
| mv "$cp_dest_dir/WebEx64.plugin" "$cp_plugin_dir" | |
| mv "$cp_dest_dir/atgpcext64.bundle" "$cp_dest_parent_dir" | |
| #dyliblist=`more "$RECEIPT_PATH/dylib.version"` | |
| odd=1 | |
| for dylib in ${dyliblist[*]}; do | |
| echo $dylib | |
| if [ $odd == 1 ]; then | |
| v_name=$dylib | |
| odd=2; | |
| else | |
| ln_name=$dylib | |
| odd=1; | |
| if [ -f "$cp_dest_dir/$ln_name" ]; then | |
| mv "$cp_dest_dir/$ln_name" "$cp_dest_dir/$v_name" | |
| ln -s "$cp_dest_dir/$v_name" "$cp_dest_dir/$ln_name" | |
| fi | |
| fi | |
| done | |
| ## | |
| rm -rf "$cp_dest_dir/Event Center.app" | |
| rm -rf "$cp_dest_dir/asannotation2.app" | |
| rm -rf "$cp_dest_dir/convertpdf.app" | |
| mv "$cp_dest_dir/Event Center" "$cp_dest_dir/Event Center.app" | |
| mv "$cp_dest_dir/asannotation2" "$cp_dest_dir/asannotation2.app" | |
| mv "$cp_dest_dir/convertpdf" "$cp_dest_dir/convertpdf.app" | |
| ## | |
| rm -rf /tmp/webex | |
| #security issue | |
| #chmod -R g+w "$cp_dest_dir" | |
| #chmod -R g+w "$cp_plugin_dir/WebEx64.plugin" | |
| #chmod -R g+w "$cp_dest_parent_dir/atgpcext64.bundle" | |
| chown -R $validuser:$validgroup "$cp_dest_dir" | |
| chown -R $validuser:$validgroup "$cp_plugin_dir/WebEx64.plugin" | |
| chown -R $validuser:$validgroup "$cp_dest_parent_dir/atgpcext64.bundle" | |
| exit 0 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment