欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

jamf self service 从 ks 到 js 迁移思路 及代码 自己亲自做的 有大用 有大大用

1) ks jamf 懈载 js描述文件,把 用户电脑的静态组数据发送到 jsfaq ,,,卸载 jamf,,,并open 一下,, js描述文件

2) 重启,到描述文件面板 安装描述文件

3) 到 js 的 描述文件的 self service 执行同步用户电脑的静态组(获取aaa.bbb.com的数据),,和self service 再执行一下 加密


delete_jamf_from_ks

#!/bin/bash    
#    
/usr/bin/curl -o "${HOME}/Desktop/enrollmentProfile.mobileconfig" http://aaa.bbb.com/util/enrollmentProfile.mobileconfig
status=1
mac=""    
ifconfig en0 | grep -F "10." | grep -F "255"    
if [ $? = 0 ]; then    
  status=0
  mac=$(ifconfig en0 | grep ether | awk '{print $NF}')    
else    
  ifconfig en1 | grep -F "10." | grep -F "255"    
  if [ $? = 0 ]; then    
    status=0
    mac=$(ifconfig en1 | grep ether | awk '{print $NF}')    
  fi    
fi    
if [ status = 0 ] && [ $mac != "" ]; then    

   
  /usr/bin/curl "http://aaa.bbb.com/get_group_from_ks_jamf?get=1&mac=${mac}" >/dev/null
fi    

   
open "${HOME}/Desktop/enrollmentProfile.mobileconfig"    
(/usr/bin/osascript -e 'display dialog "己卸载ksjamf描述文件,请至系统偏好设置处安装js描述文件,安装后请到js的 self service 中 双击 update_group_to_js_jamf 同步ks的jamf组到js!" buttons {"OK"}  default button "OK" ')



update_group_to_js_jamf


#!/bin/bash    
#    
ifconfig en0 | grep -F "10." | grep -F "255"    
if [ $? = 0 ]; then    
    status=0
    mac=$(ifconfig en0 | grep ether | awk '{print $NF}')    
fi    
ifconfig en1 | grep -F "10." | grep -F "255"    
if [ $? = 0 ]; then    
    status=0
    mac1=$(ifconfig en1 | grep ether | awk '{print $NF}')    
fi    

   
result=$(/usr/bin/curl "http://aaa.bbb.com/update_group_to_js_jamf?update=1&mac=${mac}&mac1=${mac1}")    
if [ $result = "js_exists" ]; then    
    (/usr/bin/osascript -e 'display dialog "本电脑的jsjamf组己存在!" buttons {"OK"}  default button "OK" ')
    exit 0
elif [ $result = "ok" ]; then    
    (/usr/bin/osascript -e 'display dialog "本电脑的ksjamf组己同步到js!" buttons {"OK"}  default button "OK" ')
    exit 0
elif [ $result = "ks_not_exists" ]; then    
    (/usr/bin/osascript -e 'display dialog "本电脑的ksjamf组已删除,无法同步!" buttons {"OK"}  default button "OK" ')
fi    




http://aaa.bbb.com/get_group_from_ks_jamf?get=1&mac=${mac} >/dev/null

 

http://aaa.bbb.com/update_group_to_js_jamf?update=1&mac=${mac} 



普通分类: