diff --git a/debian/shadowsocks-libev.postinst b/debian/shadowsocks-libev.postinst index f66eee0c..d6051d3d 100755 --- a/debian/shadowsocks-libev.postinst +++ b/debian/shadowsocks-libev.postinst @@ -26,12 +26,14 @@ case "$1" in cap_net_bind_service+ep /usr/bin/ss-server \ cap_net_bind_service+ep /usr/bin/ss-tunnel if [ ! -f /etc/shadowsocks-libev/config.json ]; then + set +e pathfind apg if [ $? -eq 0 ]; then passwd=$(apg -n 1 -M ncl) else passwd=$(pwgen 12 1) fi + set -e mkdir -p /etc/shadowsocks-libev sed "s/barfoo!/$passwd/" /usr/share/shadowsocks-libev/config.json \ > /etc/shadowsocks-libev/config.json