debian/postinst
changeset 32 89fb9c6611ca
parent 31 bbcb8a3366b4
child 35 3fedae1f6ceb
equal deleted inserted replaced
31:bbcb8a3366b4 32:89fb9c6611ca
    19 
    19 
    20 
    20 
    21 case "$1" in
    21 case "$1" in
    22     configure)
    22     configure)
    23 	if [ ! -f /var/lib/mcbot/data/mcbot.dat ];
    23 	if [ ! -f /var/lib/mcbot/data/mcbot.dat ];
    24 	then		
    24 	then
    25 		echo "Creating initial database in /var/lib/mcbot/data";
    25 		echo "Creating initial database in /var/lib/mcbot/data";
    26 		dbtool -a -k 1 -v 1;
    26 		dbtool -a -k 1 -v 1;
    27 		dbtool -d 1;
    27 		dbtool -d 1;
    28 	fi
    28 	fi
    29 
    29 
    31 	then
    31 	then
    32 		mv -f /var/lib/mcbot/.mcbotrc.dpkg-old /var/lib/mcbot/.mcbotrc;
    32 		mv -f /var/lib/mcbot/.mcbotrc.dpkg-old /var/lib/mcbot/.mcbotrc;
    33 	fi
    33 	fi
    34 
    34 
    35 	echo "Changing ownership in /var/lib/mcbot"
    35 	echo "Changing ownership in /var/lib/mcbot"
    36 	useradd -c "MCBOT" -s /bin/bash -d /var/lib/mcbot mcbot
    36 	useradd -K UID_MIN=100 -K UID_MAX=999 -K GID_MIN=100 -K GID_MAX=999 -c "MCBOT" -s /bin/bash -d /var/lib/mcbot mcbot
    37 	chown -R mcbot:mcbot /var/lib/mcbot
    37 	chown -R mcbot:mcbot /var/lib/mcbot
    38 	echo "Setting permissions for /var/lib/mcbot/.mcbotrc to 600"
    38 	echo "Setting permissions for /var/lib/mcbot/.mcbotrc to 600"
    39 	chmod 600 /var/lib/mcbot/.mcbotrc
    39 	chmod 600 /var/lib/mcbot/.mcbotrc
    40 	echo "ENTER /etc/init.d/mcbot restart after editing .mcbotrc"
    40 	echo "ENTER /etc/init.d/mcbot restart after editing .mcbotrc"
    41 	update-rc.d mcbot defaults &>/dev/null
    41 	update-rc.d mcbot defaults &>/dev/null