起因 server ip 固定時間會換,無法使用dns。看能不能有方法獲得server 最新ip 思路 1. 印出ip 2. 串slack 3. 排程 最終成果 ip.sh MSG=`ifconfig | grep -E 'inet.[0-9]' | grep -v '127.0.0.1' |awk '{print $2}'` CHANNEL="#serverip" USERNAME="Server" EMOJI=":ghost:" PAYLOAD="payload={\"channel\": \"$CHANNEL\", \"username\": \"$USERNAME\", \"text\": \"$MSG\", \"icon_emoji\": \"$EMOJI\"}" HOOK=https://hooks.slack.com/services/XXXXXX/BOOOOOO/n2345566 curl -X POST --data-urlencode "$PAYLOAD" "$HOOK" 建立排程檔 com.postip.plist <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>com.postip.plist</string> <key...