mirror of
				https://bitbucket.org/jsuto/piler.git
				synced 2025-10-31 09:22:26 +01:00 
			
		
		
		
	added metainfo to create deb package of piler
This commit is contained in:
		
							
								
								
									
										41
									
								
								debian/preinst
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										41
									
								
								debian/preinst
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,41 @@ | ||||
| #!/bin/sh | ||||
| set -e | ||||
|  | ||||
| create_piler_user() { | ||||
|    id piler &>/dev/null | ||||
|  | ||||
|    if [ $? -ne 0 ]; then | ||||
|       groupadd piler | ||||
|       useradd -g piler -s /bin/sh -d /var/piler piler | ||||
|       usermod -L piler | ||||
|    fi | ||||
|  | ||||
| } | ||||
|  | ||||
|  | ||||
| save_current_config() { | ||||
|    BAKFILE=/usr/local/etc/piler.conf.`date +%s` | ||||
|    cp /usr/local/etc/piler.conf $BAKFILE | ||||
| } | ||||
|  | ||||
|  | ||||
| case "$1" in | ||||
|     install) | ||||
| 	create_piler_user | ||||
|         ;; | ||||
|  | ||||
|     upgrade|abort-upgrade) | ||||
| 	save_current_config | ||||
|         ;; | ||||
|  | ||||
|     *) | ||||
|         echo "postinst called with unknown argument \`$1'" >&2 | ||||
|         exit 0 | ||||
|         ;; | ||||
| esac | ||||
|  | ||||
| #DEBHELPER# | ||||
|  | ||||
| exit 0 | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user